
2 May
2012
2 May
'12
7:03 a.m.
Hello. In order to learn GADTs, I have written the attached program, which defines a type for arithmetic expressions using GADTs, a parser for them, and an evaluation function. But my parser does not typecheck. ghc-7.4.1 gives me the error message: Expr.hs:25:28: Couldn't match expected type `Double' with actual type `Bool' Expected type: Bool -> Expr Double Actual type: Bool -> Expr Bool In the first argument of `(<$>)', namely `B' In the first argument of `(<|>)', namely `B <$> pBool' Any clues on how to fix that? Romildo