module Exercise_6 where import Data.Ratio {-WETT-} traceFractran :: [Rational] -> Integer -> [Integer] traceFractran fs n = let prods = [numerator (n%1 * f) | f <- fs, denominator (n%1 * f) == 1] in if null prods then [n] else n : traceFractran fs (head prods) {-TTEW-}