On Fri, Jan 27, 2012 at 10:30 AM, Christian Höner zu Siederdissen
<choe...@tbi.univie.ac.at> wrote:
> out of curiosity I have taken a look at
> https://github.com/choener/BiobaseFasta/blob/master/Biobase/Fasta/Import.hs
> thinking about how this would look like using conduit.
>
> How does one implement "unfoldConvStream" in conduit?

(I'm not familiar with the iteratee library -- only with the
enumerator library -- so I may be off target here.)

If I'm reading unfoldConvStream's type correctly, its counterpart is
sequenceSink [1]

[1] 
http://hackage.haskell.org/packages/archive/conduit/0.1.1.1/doc/html/Data-Conduit.html#v:sequenceSink

> Right now, I'd assume to need a StateT which carries the state?
>
> ==
>
> explanation: I carry fasta headers and window positions in a state, so
> that very large fasta files can be worked on in constant space.
>
> ==

Note that Sources, Conduits and Sink all may carry any state they want
using references [2].  That sequenceSink function is just a convenient
wrapper.

[2] 
http://hackage.haskell.org/packages/archive/conduit/0.1.1.1/doc/html/Control-Monad-Trans-Resource.html#g:4

Cheers! =)

-- 
Felipe.
_______________________________________________
Biohaskell mailing list
Biohaskell@biohaskell.org
http://malde.org/cgi-bin/mailman/listinfo/biohaskell

Reply via email to