Anyone ever needed this? Me and John Wiegley were discussing a decent
name for it, John suggested inv as in involution. E.g.

inv reverse (take 10)
inv reverse (dropWhile isDigit)
trim = inv reverse (dropWhile isSpace) . dropWhile isSpace

That seems to be the only use-case I've ever come across.

There's also this one:

co f g = f g . g

which means you can write

trim = co (inv reverse) (dropWhile isSpace)

but that's optimizing an ever rarer use-case.

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to