[Haskell-cafe] inv f g = f . g . f
tdammers at gmail.com
Sat Aug 17 16:52:38 CEST 2013
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 Aug 17, 2013 3:35 PM, "Tom Ellis" <
tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk> wrote:
> 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.
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe