[Haskell-cafe] Type system trickery

Andrew Coppin andrewcoppin at btinternet.com
Sun Jun 21 16:16:12 EDT 2009


Niklas Broberg wrote:
> That's what GADTs are for:
>
> data Flag = HasZoo | NoZoo
>
> data Foobar a where
>   Foo :: Foobar a -> Foobar a
>   Bar :: Foobar a -> Foobar a
>   Zoo :: Foobar a -> Foobar HasZoo
>   

Ouch #1: This appears to instantly disable deriving the Eq, Ord and Show 
instances I want. :-/



More information about the Haskell-Cafe mailing list