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
module Parser where | |
-- won't work because type class instances must not be type synonyms | |
-- type Parsera res = String -> (Either String res, String) | |
-- data Parser res = Parser (String -> (Either String res, String)) | |
-- parse (Parser p) = p | |
-- or with `newtype` | |
newtype Parser res = Parser { parse :: String -> (Either String res, String) } |
NewerOlder