So the following isn't as clever as the line-noise Don posted, but
should be in the ball-park.

dropFromEnds p = dropWhile p . dropWhileEnd p

dropWhileEnd p bs = take (findFromEndUntil (not p) bs) bs

takeWhileEnd p bs = drop (findFromEndUntil p bs) bs

{- findFromEndUntil is in ByteString.hs, but is not exported -}

T.
--
Dr Thomas Conway
[EMAIL PROTECTED]

Silence is the perfectest herald of joy:
I were but little happy, if I could say how much.
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to