
16 Aug
2005
16 Aug
'05
4:15 p.m.
On Tuesday 16 August 2005 21:56, Keean Schupke wrote:
You can even use existential types to create lists of things with a common interface, where you do not know in advance what types you may need:
data XWrap = XWrap (forall a . Show a => a) type ListXWrap = [XWrap]
You probably meant to write data XWrap = forall a . Show a => XWrap a or, in GADT style (which I find a bit more intuitive here): data XWrap where XWrap :: Show a => a -> XWrap Ben