module Exercise_6 where import Data.Ratio import Data.List traceFractran :: [Rational] -> Integer -> [Integer] {-WETT-} traceFractran xs n = case find (\x -> denominator (x * toRational n) == 1) xs of Just x -> n : traceFractran xs (numerator $ x * toRational n) Nothing -> [n] {-TTEW-}