I'm confused about the arrow and what it actually means in the data constructor. I'm surprised it even compiled but I have no idea how to use it.
If I try to use it as the name of a data constructor it doesn't parse, and I'm not sure how else to interpret it. If I interpret it as a function type then the data constructor has no name which also does not make sense to me.
data Type
= TBool
| TInt
| Arrow Type Type
| (->) Type Type
test :: Type
test = Arrow TBool TInt -- Ok
test' :: Type
test' = (->) TBool TInt -- Parse Error on input '->'
It does look like a GHC bug (thanks to Kevin Buhr for reporting it) in the use case you provided.
Note
This does fail to parse with GADTs
:
data Type where
TBool :: Type
TInt :: Type
Arrow :: Type -> Type -> Type
(->) :: Type -> Type -> Type
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With