[Haskell-cafe] Re: Why so slow?

apfelmus at quantentunnel.de apfelmus at quantentunnel.de
Mon Dec 11 06:32:15 EST 2006


Lyle Kopnicky wrote:
> The code below is using way more RAM than it should. It seems to only
> take so long when I build the 'programs' list - the actual
> reading/parsing is fast. For a 5MB input file, it's using 50MB of RAM!
> Any idea how to combat this?

(ethereal voice)
... Children of Amaunator ... heed my words ... in no long, the world
... will perish, will ... crumble under the blackened forces of IO ...
but there is ... hope ... i can feel that ...
    ensure :: (a -> Bool) -> String -> a -> a
    ensure b s x = if b x then x else error s
... or switching to ... monadic parser combinators ... like
Text.ParserCombinators.Parsec ... can hold strong the light for ...
another aeon or two ...



Regards,
afpelmus



More information about the Haskell-Cafe mailing list