[Haskell-cafe] Lists of Existential DT
pumpkingod at gmail.com
Sun Feb 28 13:52:31 EST 2010
You can actually write that type with impredicative polymorphism, but it
doesn't do what you seem to want: it makes a list of polymorphic values
(i.e., universally quantified ones, not existentially).
But that's going away soon, anyway...
On Sun, Feb 28, 2010 at 1:49 PM, Yves Parès <limestrael at gmail.com> wrote:
> jkff wrote:
> > Or like this, with the benefit of using lists.
> > data DrawableObj a = forall a.Drawable a => DrawableObj a
> > a <,> b = DrawableObj a : b
> > drawMany (a<,>b<,>c<,>)
> I like this solution, but it's a pity I think that Haskell doesn't provide
> way to use types like [forall a. (Drawable a) => a], which obligates you to
> declare an extra datatype...
> Yves Parès
> Live long and prosper
> View this message in context:
> Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe