[Haskell-cafe] Strings in Haskell
Bryan Donlan
bd.haskell at uguu.us
Mon Jan 22 21:37:21 EST 2007
Neil Mitchell wrote:
> Hi Alexy,
>
>> Now I'm reading a
>> Haskell book which states the same. Is there a more efficient Haskell
>> string-handling method? Which functional language is the most
>> suitable for text processing?
>
> There are the Data.ByteString things, which are great, and have much
> less overhead.
>
> But remember that Haskell is lazy. If you are thinking "well I have to
> process a 50Mb file", remember that Haskell will lazily read and
> process this file, which substantially reduces the memory requirements
> so only a small portion will ever be in memory at a time.
Or you can get the best of both worlds by using Data.ByteString.Lazy :)
Even with laziness, all the indirections that String causes hurts
performance.
More information about the Haskell-Cafe
mailing list