Skip to content

Instantly share code, notes, and snippets.

@vhxs
Created December 6, 2022 00:49
Show Gist options
  • Save vhxs/d305bb7306d71ecd4554888cd8ddd8a4 to your computer and use it in GitHub Desktop.
Save vhxs/d305bb7306d71ecd4554888cd8ddd8a4 to your computer and use it in GitHub Desktop.
Parsing in Haskell
amount line = read (splitOn "from" ((splitOn "move" line)!!1)!!0) :: Int
src line = read (splitOn "to" ((splitOn "from" line)!!1)!!0) :: Int
dst line = read (splitOn "to" ((splitOn "from" line)!!1)!!1) :: Int
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment