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 with hugs fails with the following error:
ERROR "types.hs":16 - Syntax error in data type declaration (unexpected `|')
Line 16 is the line with the first |
in the code above.