I'm in the process of writing a small lisp interpreter in haskell. In the process i defined this datatype, to get a less typed number;
data Number = _Int Integer
| _Rational Rational
| _Float Double
deriving(Eq,Show)
Compiling this fails with the following error:
ERROR "types.hs":16 - Syntax error in data type declaration (unexpected `|')
Line 16 is the line w. the first '|' in the code above.
Edit: It would appear that the underscores in the type constructors are causing the problem.