module Exercise_6 where import Data.Ratio import Data.List import Data.Maybe {-WETT-} traceFractran :: [Rational] -> Integer -> [Integer] traceFractran xs y = if isNothing n then [y] else y : traceFractran xs (numerator $ fromJust n) where n = find (\x -> denominator x == 1) $ (y%1 *) <$> xs {-TTEW-}