Note that at least for the dropWhile example, there is a specialized function, dropWhileEnd, which is most likely more efficient than reversing the list twice.
On Sat, Aug 17, 2013 at 11:11:07AM +0200, Christopher Done wrote:
> 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
This sounds like a job for a lens, or similar.
Tom
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe