<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">2017-04-03 18:38 GMT+02:00 Henning Thielemann <span dir="ltr"><<a href="mailto:lemming@henning-thielemann.de" target="_blank">lemming@henning-thielemann.de</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-"><br>
On Mon, 3 Apr 2017, David Feuer wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
That leaves a few trouble spots:<br>
<br>
1. There are types that some people think shouldn't have Functor/Foldable/Traversable instances at all, or that some people would like to have Functor and maybe even Traversable instances for without wanting Foldable instances. The latter is impossible because of a superclass constraint. One essential issue here seems to be one of perspective: is Foo x y a container of ys, decorated with xs, or is it a container of xs and ys? Different people tend to think about this differently, and thus form different intuitions.<br>
</blockquote>
<br></span>
I don't know if anyone has a problem with interpreting a custom data type Foo x y as a container of ys decorated with xs - if it is defined for that purpose. Discussion arose solely about the cases Foo = (,), Foo = (,,) x and so on.</blockquote><div><br></div><div>Of course such an interpretation is possible, but let's remember Abelson's famous quote:</div><div><br></div><div>   "Programs must be written for people to read, and only incidentally for machines to execute."<br></div><div><br></div><div>When you show somebody a pair and ask "What is this?", how many people do you *seriously* expect to say "Oh, yeah, I've seen that: It's a value on the right decorated by another one on the left!" compared to people telling you something about e.g. cartesian products (which are totally symmetric with no bias to the right or left)? The point is: Using a pair for a decorated one-element container is completely miscommunicating your intent, even if you find a sensible mathematical interpretation for it. All the programs from <a href="http://www.ioccc.org/">http://www.ioccc.org/</a> have a sensible mathematical interpretation, too, but that doesn't mean I want to see them outside of that contest. ;-)</div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> E.g. I actually proposed to define a custom data type like Decorated x y instead of (x,y) in case you want to have a Foldable instance.</blockquote><div><br></div><div>*This* is communicating you intent IHMO, and I doubt you need more types for different arities: If you e.g. want to have 3 values for decoration, just use a triple (or something isomorphic) with Decorated. This is much clearer than having a family of Decorated, Decorated2, Decorated3, ...</div></div></div></div>