<div dir="ltr">Haskell's notion of Functor is in fact somewhat arbitrary from the standpoint of mathematical functors. It's not at all arbitrary from the standpoint of the general variety of type system Haskell uses. I'd call it a "deep design choice" rather than a "technical limitation". I think the newtype I gave for Flip and the type family I gave for FlipF are the best you're ever likely to see. I do hope that the status of type families will improve somewhat in the future (e.g., I'd love to be able to map a type family over a list of types), but that won't get you the sorts of instances you're dreaming of.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Feb 24, 2016 at 4:56 PM, Kosyrev Serge <span dir="ltr"><<a href="mailto:_deepfire@feelingofgreen.ru" target="_blank">_deepfire@feelingofgreen.ru</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">David Feuer <<a href="mailto:david.feuer@gmail.com">david.feuer@gmail.com</a>> writes:<br>
> On Wed, Feb 24, 2016 at 11:22 AM, Kosyrev Serge <_<a href="mailto:deepfire@feelingofgreen.ru">deepfire@feelingofgreen.ru</a>> wrote:<br>
> > Are you also saying that this cannot be resolved by some kind of a<br>
> > type families-based type-level 'flip'?<br>
><br>
> It really can't, no. You can define<br>
><br>
> type family FlipF f a b where<br>
> FlipF f a b = f b a<br>
><br>
> but FlipF, being a type family, is not first-class. You can't make any<br>
> instances whatsoever for FlipF f a -- you'll probably get an error<br>
> about a partially applied type family. What you *can* do is make a<br>
> Flip newtype:<br>
><br>
> newtype Flip f a b = Flip {unflip :: f b a}<br>
<br>
</span>How wrong would it be to say that the conceptually arbitrary choice of<br>
the Functor instance is "saved" by a technical limitation, making it the<br>
only choice?<br>
<br>
How likely is a proper type-level 'flip' tomorrow -- for some value of<br>
"proper" and "tomorrow"?<br>
<div class="HOEnZb"><div class="h5"><br>
--<br>
с уважениeм / respectfully,<br>
Косырев Сергей<br>
</div></div></blockquote></div><br></div>