[Haskell-beginners] Heterogeneous Lists

Giacomo Tesio giacomo at tesio.it
Wed Aug 14 15:21:13 CEST 2013


> > I recently ran into this with a GUI application, where I needed to
> > process a list of widgets that were members of the same typeclass, but
> > I had to wrap them all because they were different types.
>
> Your misconception is likely that you need to /store/ widgets, because
> you think in terms of memory.  What you really need is /definitions/ of
> widgets, which can very well have different types.  Then you can combine
> them using the usual monadic or applicative interface.
>
>
Ertugrul, can you please expand on this?


Giacomo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/beginners/attachments/20130814/dc98d787/attachment.htm>


More information about the Beginners mailing list