[Haskell-cafe] Vector to Monadic Stream and back, how?

Xiao-Yong Jin xj2106 at columbia.edu
Tue Apr 13 19:05:56 EDT 2010

Dear list,

I'm trying to change my code from using Data.Array to
Data.Vector.  I have some question regarding the monadic use
of 'Vector'.  Searching through the list couldn't give me
enough hints, so I guess I'd try my luck asking on the list.

I want to use 'mapM' on Data.Vector.Vector, but it looks
like the only 'mapM' defined is in
Data.Vector.Fusion.Stream.Monadic.  I'm able to use 'stream'
and 'liftStream' to convert a 'Vector' to a monadic stream,
on which I can use 'mapM'.  But I couldn't find a way to
convert the monadic stream back to Vector without using an
intermediate list.  I don't think I understand the internal
of monadic stream that much.  But it looks not so fusion to
me.  Is it the only way back to Vector?

J    c/*    __o/*
X    <\     * (__
Y    */\      <

More information about the Haskell-Cafe mailing list