Skip to content

Instantly share code, notes, and snippets.

@plaster
Created December 11, 2015 18:42
Show Gist options
  • Save plaster/79b8a90e55abeaeb6cf7 to your computer and use it in GitHub Desktop.
Save plaster/79b8a90e55abeaeb6cf7 to your computer and use it in GitHub Desktop.
-- 4回readしたいけどこれで正しいか?もしくはもっとシンプルな書き方があるか?
parse :: String -> (Int, Int, Int, Int)
parse s = (c1, p1, c2, p2) where
[(c1, s')] = readsPrec 10 s
[(p1, s'')] = readsPrec 10 s'
[(c2, s''')] = readsPrec 10 s''
[(p2, s'''')] = readsPrec 10 s'''
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment