Why won't the following haskell code compile?
Posted
by voxcogitatio
on Stack Overflow
See other posts from Stack Overflow
or by voxcogitatio
Published on 2010-03-17T23:05:40Z
Indexed on
2010/03/17
23:11 UTC
Read the original article
Hit count: 246
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.
© Stack Overflow or respective owner