[Haskell-cafe] file splitter with enumerator package

Eric Rasmussen ericrasmussen at gmail.com
Sun Jul 24 20:00:37 CEST 2011


Since the program only needs to finish a line after it's made a bulk
copy of a potentially large chunk of a file (could be 25 - 500 mb), I
was hoping to find a way to copy the large chunk in constant memory
and without inspecting the individual bytes/characters. I'm still
having some difficulty with this part if anyone has suggestions.

Thanks again,
Eric


On Sun, Jul 24, 2011 at 10:34 AM, Felipe Almeida Lessa
<felipe.lessa at gmail.com> wrote:
> On Sun, Jul 24, 2011 at 12:28 PM, Yves Parès <limestrael at gmail.com> wrote:
>> If you used Data.Enumerator.Text, you would maybe benefit the "lines"
>> function:
>>
>> lines :: Monad m => Enumeratee Text Text m b
>
> It gets arbitrary blocks of text and outputs lines of text.
>
>> But there is something I don't get with that signature:
>> why isn't it:
>> lines :: Monad m => Enumeratee Text [Text] m b
>> ??
>
> Lists of lines of text?
>
> Cheers, =)
>
> --
> Felipe.
>



More information about the Haskell-Cafe mailing list