
22 Jun
2009
22 Jun
'09
4:06 p.m.
On Sun, Jun 21, 2009 at 09:16:12PM +0100, Andrew Coppin wrote:
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. :-/
Ah, yes, that is a pain. Maybe try playing around with tools like Data.Derive? I haven't played with them much myself so I don't know if they will help. -Brent