-
-
Save simonmichael/677fdf7df3a20067612b3e625d4888c1 to your computer and use it in GitHub Desktop.
parsing with scanf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
parsePoints s = s | |
& lines | |
& map (SC.scanf [SC.fmt|position=<%d, %d> velocity=<%d, %d>|]) | |
& catMaybes | |
& map (SC.printf [SC.fmt|((%d,%d), (%d,%d))|]) | |
& map read :: [Point] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment