[Haskell-cafe] bimap 0.2

Loup Vaillant loup.vaillant at gmail.com
Tue Feb 5 05:50:08 EST 2008

2008/2/5, Neil Mitchell <ndmitchell at gmail.com>:
> 3)
> insert x y = delete  x
>          >>> deleteR y
>          >>> unsafeInsert x y
> Why not:
> insert x y = unsafeInsert x y . delete x . delete y
> Now you don't end up using the arrow combinators, and it becomes more
> readable (at least to me). Of course, this function may disappear
> entirely if what I wrote in (2) is correct.

I'd rather prefer the arrow combinator: it let me read the composition
in natural order. Sure, ">>>" is more verbose than ".", and less
idiomatic, but I tend to think it scale a bit more (in the case of
bigger compositions). Well, maybe just a matter of taste...


More information about the Haskell-Cafe mailing list