
David Feuer
On Wed, Feb 24, 2016 at 11:22 AM, Kosyrev Serge <_deepfire@feelingofgreen.ru> wrote:
Are you also saying that this cannot be resolved by some kind of a type families-based type-level 'flip'?
It really can't, no. You can define
type family FlipF f a b where FlipF f a b = f b a
but FlipF, being a type family, is not first-class. You can't make any instances whatsoever for FlipF f a -- you'll probably get an error about a partially applied type family. What you *can* do is make a Flip newtype:
newtype Flip f a b = Flip {unflip :: f b a}
How wrong would it be to say that the conceptually arbitrary choice of the Functor instance is "saved" by a technical limitation, making it the only choice? How likely is a proper type-level 'flip' tomorrow -- for some value of "proper" and "tomorrow"? -- с уважениeм / respectfully, Косырев Сергей