Fractran: Difference between revisions
m
→Reading the program: (specialized a type signature slightly to enable compilation)
m (Minor linting of English grammar in task description (step -> steps)) |
m (→Reading the program: (specialized a type signature slightly to enable compilation)) |
||
Line 1,759:
Additional import
<lang Haskell>import Data.List.Split (splitOn)</lang>
<lang Haskell>readProgram :: String -> [Ratio
readProgram = map (toFrac . splitOn "/") . splitOn ","
where toFrac [n,d] = read n % read d</lang>
|