[Haskell-cafe] flip1 through flip9, useful?

John Lato jwlato at gmail.com
Tue Jan 14 23:40:01 UTC 2014

On Tue, Jan 14, 2014 at 3:30 PM, Christian Marie <christian at ponies.io>wrote:

> On Tue, Jan 14, 2014 at 04:57:14PM +1000, Tony Morris wrote:
> >    Why not generalise to any functor?
> >    let flip f a = fmap ($a) f
> I didn't think of that, I suppose.
> Now that I do, it seems to be a tradeoff between (arguably) less
> immediately
> obvious type signatures and something.
> I can't actually think of what that something is yet. Can you think of a
> real
> world use for a functor flip where normal flip wouldn't do?

I know I've written "fmap ($a) f" in the past, so I guess any of those
would be a use case for a functor flip.  On the other hand, it's only a few
characters longer than flip, and arguably more clear, so I'm not convinced
that generalizing flip is useful.  YMMV.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20140114/9bcb8b9b/attachment.html>

More information about the Haskell-Cafe mailing list