Using existential types
ddarius at hotpop.com
Mon Oct 13 13:14:09 EDT 2003
On Mon, 13 Oct 2003 11:37:43 -0400
Jan-Willem Maessen <jmaessen at MIT.EDU> wrote:
> > So, the existential quantification permits more nuanced
> > transformations -- and yet the nuances aren't observable. So, they
> > don't matter?
> Whether they matter or not depends upon our aims. I'm curious about
> what's possible---in the hopes that I can get a better handle on
> what's really desirable in a particular situation.
Indeed. One of the issues is useability or at least naturality. It
seems that existentials in some situations better achieve the
intent/goal. Anyways, if another challenge is desired, I would be
interested in seeing how one would go about converting the
implementation of Dynamics in "A Lightweight Implementation of Generics
and Dynamics" into a form that doesn't use existentials* but still
provides the same (or very similar or I guess simpler) interface.
* No coding existentials as universals :P
data Showable = Showable (forall r.(forall a.Show a => a -> r) -> r)
mapM_ (\(Showable v) -> v print) [Showable ($ 5),Showable ($ True)]
More information about the Haskell-Cafe