module Exercise_6 where import Data.Ratio -- Could have been implemented using find and Data.Maybe, but I kinda like the fact -- that this requires no additional imports. traceFractran :: [Rational] -> Integer -> [Integer] {-WETT-} traceFractran xs n = n:if null y then mempty else traceFractran xs . numerator $ head y where y = fmap (==1) denominator `filter` map (* toRational n) xs {-TTEW-}