Last active
August 29, 2015 14:02
-
-
Save laser/12b32337da74f9c7973a to your computer and use it in GitHub Desktop.
cryptic error message
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
*Cis194.Hw.SExpr> :r | |
[2 of 2] Compiling Cis194.Hw.SExpr ( src/Cis194/Hw/SExpr.hs, interpreted ) | |
src/Cis194/Hw/SExpr.hs:84:38: | |
Couldn't match type `SExpr' with `Atom' | |
Expected type: [SExpr] -> Atom | |
Actual type: [SExpr] -> SExpr | |
In the first argument of `pure', namely `(Comb)' | |
In the first argument of `(<*>)', namely `pure (Comb)' | |
In the second argument of `(<|>)', namely | |
`(pure (Comb) <*> (char '(' *> some parseSExpr <* char ')'))' | |
Failed, modules loaded: Cis194.Hw.AParser. | |
*Cis194.Hw.AParser> |
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
parseAtom :: Parser Atom | |
parseAtom = (pure (N) <*> posInt) <|> (pure (I) <*> ident) | |
parseSExpr :: Parser SExpr | |
parseSExpr = spaces *> parse <* spaces | |
where parse = parseAtom <|> (pure (Comb) <*> (char '(' *> some parseSExpr <* char ')')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment