asConduit appears to create a conduit which consumes the entire sequence; then when done, binds cons steps into it's Done constructor.
After the conduit is completely consumed, the stream function is applied. To demonstrate, I believe this code is effectively equivalent (this also shows that the stream consumed contains precisely 0 Effect constructors).
overList :: (Monad m) => ([i] -> [o]) -> ConduitM i o m ()
overList f = join . fmap (Conduit.sourceList . f) $ go
where
go = do mo <- await
case mo of
Nothing -> return []
Just o -> (o :) <$> go
I'm not convinced that this type signature is able to be implemented satisfactorily. Although one should be able to with a stream Stream (Of i) (ConduitT i o m) ().
asConduitappears to create a conduit which consumes the entire sequence; then when done, binds cons steps into it'sDoneconstructor.After the conduit is completely consumed, the stream function is applied. To demonstrate, I believe this code is effectively equivalent (this also shows that the stream consumed contains precisely 0
Effectconstructors).I'm not convinced that this type signature is able to be implemented satisfactorily. Although one should be able to with a stream
Stream (Of i) (ConduitT i o m) ().