[Haskell-beginners] Heterogeneous Lists
Brandon Allbery
allbery.b at gmail.com
Tue May 28 16:30:03 CEST 2013
On Tue, May 28, 2013 at 10:00 AM, harry <voldermort at hotmail.com> wrote:
> So so rephrase my question, why can't type classes be used as a type? Is
> this an implementation issues, or is there a semantic problem with this?
> Creating an existential type and packing all the values seems like busy
> work
> which shouldn't be necessary, or at least something that the compiler
> should
> be doing for me.
Haskell is strongly typed; if you want to throw out all the type
information, you must tell if explicitly (which is what the existential
does). This comes at a price, of course: once you've thrown out the type
information, you can't get it back.
--
brandon s allbery kf8nh sine nomine associates
allbery.b at gmail.com ballbery at sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/beginners/attachments/20130528/24565418/attachment.htm>
More information about the Beginners
mailing list