module Exercise_6 where import Data.Ratio import Data.List import Data.Maybe {-WETT-} traceFractran :: [Rational] -> Integer -> [Integer] traceFractran fs n = n : if isJust res then traceFractran fs (numerator (fromJust res)) else [] where res = find ((==1) . denominator) $ map (* (fromIntegral n)) fs {-TTEW-}