
28 Sep
2007
28 Sep
'07
4 a.m.
Hello Stefan, Friday, September 28, 2007, 1:10:09 AM, you wrote:
data Foo a where A :: Foo Int B :: Foo Bool
becomes
data Foo a = (a ~ Int) => A | (a ~ Bool) => B
hm :) this looks like my quasi-proposal of unifying data and function definitions still has some meaning. i proposed to define GADTs as data Foo Int = A Foo Bool = B but, with help of guards, this may be also written as data Foo a | a==Int = A | a==Bool = B next step should be to add pattern guards? :) -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com