module Exercise_6 where import Data.List import Data.Maybe import Data.Ratio {-WETT-} traceFractran :: [Rational] -> Integer -> [Integer] traceFractran rs n = n : maybe [] (traceFractran rs . floor . (* toRational n)) (find ((== 1) . denominator . (* toRational n)) rs) {-TTEW-}