Created
May 31, 2017 03:05
-
-
Save khibino/f17211facd7f254264f818595d788401 to your computer and use it in GitHub Desktop.
This file contains 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
type Parser a = String -> [(a, String)] | |
return_ :: a -> Parser a | |
return_ v = \inp -> [(v, inp)] | |
failure :: Parser a | |
failure = \inp -> [] | |
item = \inp -> case inp of | |
[] -> [] | |
(x:xs) -> [(x,xs)] | |
parse :: Parser a -> String -> [(a, String)] | |
parse p inp = p inp |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
example code of "programming haskell".
executing in ghci