
5 Feb
2008
5 Feb
'08
5:50 a.m.
2008/2/5, Neil Mitchell
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... Loup