[Haskell-beginners] How to show a record

martin martin.drautzburg at web.de
Sun Aug 17 21:33:41 UTC 2014


Am 08/17/2014 06:46 PM, schrieb Julian Birch:
> I think what Martin is aiming at is heterogeneous collections.  http://www.haskell.org/haskellwiki/Heterogenous_collections
> 
> As you can see from the article, you can do "the same thing" to a bunch of objects of different types, but you've still
> got to "pack" them explicitly first.  So in this particular case the answer is that it's not worth the effort.  This may
> seem ridiculous, but it turns out that Haskell's approach gives you a lot of power in other areas.
> 
> Julian
> 
> 
> On 17 August 2014 13:57, Francesco Ariis <fa-ml at ariis.it <mailto:fa-ml at ariis.it>> wrote:
> 
>     On Sun, Aug 17, 2014 at 12:08:57PM +0100, Karolis Velicka wrote:
>     > In that case, can you elaborate please? I don't see how this is different
>     > to making the record itself an instance if Show.
> 
>     If by "no difference" you mean "equivalent output", I guess we can ditch
>     Haskell and write programs in Basic.
> 
>     What Martin is asking for is how you could implement such a feature if
>     something like |deriving (Show)| weren't there.

Thanks for pointing out Heterogenous_collections to me.


More information about the Beginners mailing list