module Exercise_6 where import Data.List import Data.Ratio {-WETT-} {- http://zvon.org/other/haskell/Outputlist/find_f.html => Maybe a) Nothing -> Kein Suchergebnis b) Just val -> Ergebnis val n : ... Laziness := https://piazza.com/class/k0p7t3553ta63i?cid=247 https://www.schoolofhaskell.com/school/starting-with-haskell/introduction-to-haskell/6-laziness -} traceFractran :: [Rational] -> Integer -> [Integer] traceFractran fs n = n : res where res = case find (\f -> mod n (denominator f) == 0) fs of Just val -> traceFractran fs $ round $ val * (n%1) Nothing -> [] {-TTEW-}