[Haskell-cafe] parse error on input `&'

Daniel Fischer daniel.is.fischer at web.de
Sat Apr 25 13:36:50 EDT 2009


Am Samstag 25 April 2009 19:29:30 schrieb siso dagbovie:
> Hi,
>
> I've defined the following datatype with haskell
>
> data Graph a b = Empty | Context a b & Graph a b
>
> But I am having the error message: " parse error on input `&'  ".
> I am wondering what it is wrong with my definition. How can I fix this?
> Thanks in advance.
>

A constructor symbol has to start with a colon, so make it

data Graph a b = Empty | Context a b :& Graph a b

(or :&: if you prefer it more symmetric)

>
> Kind regards

Cheers,
Daniel


More information about the Haskell-Cafe mailing list