
30 Oct
2006
30 Oct
'06
9:12 a.m.
Ashley Yakeley wrote:
data MyGADT a where MyInt :: MyGADT Int MyChar :: MyGADT Char
never :: MyGADT Bool -> a
Annoyingly, this doesn't compile without adding a definition line mentioning a bottom value.
This can't be fixed because the desugaring is ambiguous. never might be _|_ or \x. _|_ or \x y. _|_ or ... How about never :: MyGADT Bool -> a never x = case x of {} which is just the desugared form of your intended empty definition? GHC doesn't allow it, but it would be a simple extension. -- Ben