Well, maybe I shoud be asking a higher level question then.

I have a function

tidy = reverse . dropWhile punk . reverse . dropWhile punk
   where
   punk = isPunctuation . chr . fromIntegral

which is leading to a significant amount of allocation, and you can see why.

The way I'd like to write it is

tidy = dropWhile punk . dropWhileEnd punk
   where ....

which has the obvious advantage of avoiding quite a bit of
intermediate allocation.

Is there a another way?

I note that since I'm using a nice declarative language, the compiler
CLEARLY should be transforming the first form into the second. :-)

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
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to