RosettaCodeData/Task/Fractran/Haskell/fractran-3.hs

4 lines
131 B
Haskell
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
readProgram :: String -> [Ratio Int]
readProgram = map (toFrac . splitOn "/") . splitOn ","
where toFrac [n,d] = read n % read d