On May 18, 11:57 am, Oscar Finnsson <oscar.finns...@gmail.com> wrote:
> > forall d.   gunfold k z c = k (z (DataBox::d->DataBox d))
>
> Didn't work either. :(

I looked again at the paper (page 27):
Haskell's Overlooked object system.
http://homepages.cwi.nl/~ralf/OOHaskell/paper.pdf

I think the forall is suppose to be in the constructor (as opposed to
where I put it) and I don't think you need algebraic datatypes.

data DataBox = forall d. (Show d, Eq d, Data d) => DataBox d

I am not sure if this requires any extensions. Try it with and without
the extension "explcit forall"

You can also try this with a class called MakeDataBox and make d an
instance of make data box.

good luck.
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to