<div dir="ltr">I think what Martin is aiming at is heterogeneous collections.  <a href="http://www.haskell.org/haskellwiki/Heterogenous_collections">http://www.haskell.org/haskellwiki/Heterogenous_collections</a><div><br></div>
<div>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.</div>
<div><br></div><div>Julian</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On 17 August 2014 13:57, Francesco Ariis <span dir="ltr"><<a href="mailto:fa-ml@ariis.it" target="_blank">fa-ml@ariis.it</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">On Sun, Aug 17, 2014 at 12:08:57PM +0100, Karolis Velicka wrote:<br>
> In that case, can you elaborate please? I don't see how this is different<br>
> to making the record itself an instance if Show.<br>
<br>
</div>If by "no difference" you mean "equivalent output", I guess we can ditch<br>
Haskell and write programs in Basic.<br>
<br>
What Martin is asking for is how you could implement such a feature if<br>
something like |deriving (Show)| weren't there.<br>
<div class=""><br>
On 17 Aug 2014 10:44, "martin" <<a href="mailto:martin.drautzburg@web.de">martin.drautzburg@web.de</a>> wrote:<br>
> Right, but this is merely a coincidence.<br>
><br>
> What I wanted is a way to show a value of a record, where all fields are<br>
> instances of Show.<br>
><br>
> Haskell itself is able to do this (and it even figures out the accessors,<br>
> which I am not even asking for).<br>
<br>
</div>Martin, as far as I know this is not possible in standard ^Haskell 2010^ [1].<br>
To perform this kind of magic people use ^Template Haskell^ [2], which is,<br>
in so many words, a meta programming extension for GHC; with it you can<br>
handle and go-back-and-forth between Concrete Syntax and the Abstract Syntax<br>
Tree.<br>
Template Haskell isn't type safe and that goes "against the grain" of<br>
Haskell-the-language itself, I suppose (for sure it goes against mine);<br>
it is used in some popular libraries (e.g. lens, yesod).<br>
<br>
<br>
[1] <a href="http://www.haskell.org/onlinereport/haskell2010/" target="_blank">http://www.haskell.org/onlinereport/haskell2010/</a><br>
[2] <a href="http://www.haskell.org/haskellwiki/Template_Haskell" target="_blank">http://www.haskell.org/haskellwiki/Template_Haskell</a><br>
<br>_______________________________________________<br>
Beginners mailing list<br>
<a href="mailto:Beginners@haskell.org">Beginners@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/beginners" target="_blank">http://www.haskell.org/mailman/listinfo/beginners</a><br>
<br></blockquote></div><br></div>