[Haskell-cafe] efficient chop
leather at cs.uu.nl
Wed Sep 14 17:24:32 CEST 2011
On Wed, Sep 14, 2011 at 05:03, Kazu Yamamoto wrote:
> I would like to have an efficient implementation of the chop function.
> Are there any more efficient implementations of chop? Any suggestions?
chop xs = go xs id ""
go "" _ = id
go (c:cs) ss | isSpace c = go cs (ss . (:) c)
go (c:cs) ss | otherwise = ss . (:) c . go cs id
I haven't looked at the performance, but I would like to know how well it
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe