Make lines stricter to fix a space leak
Christian.Maeder at dfki.de
Mon Sep 27 04:54:56 EDT 2010
Am 24.09.2010 21:21, schrieb Daniel Fischer:
> Proposal: A stricter implementation of lines.
> Reason: The current implementation causes a space leak (cf.
> http://homepages.inf.ed.ac.uk/wadler/papers/leak/leak.ps), at least in GHC.
> The proposed implementation fixes the leak at the small cost of being
> stricter if the first _|_ in the String is the first character of a line.
> Discussion period: Three weeks, until 15th October (because of ICFP).
> Ticket: http://hackage.haskell.org/trac/ghc/ticket/4334
You make interesting proposals. Changing a let to a case!
I wonder if a generic version costs performance?
lines = breaksBy (== "\n")
(or "linesBy" or "splitBy")
More information about the Libraries