4 ms·
Worth noting that ListTs bind isn't associative for most base monads including IO and it is deprecated for a reason. Also, by it's nature ListT can't stream IO
by Tarean 9y ago
Worth noting that ListTs bind isn't associative for most base monads including IO and it is deprecated for a reason.
Also, by it's nature ListT can't stream IO unless you use lazy IO aka lazyRead aka unsafeInterleaveIO which deserves its name.
- willtim 9y agoI am assuming "ListT done right" not the deprecated one (which is not even a chain of actions). Here is a definition, to be completely clear: newtype ListT m a = ListT (m (Maybe (a, ListT m a))) It is a nice simple example of an effectful streaming type. > Also, by it's nature ListT can't stream IO This is only true of the deprecated one, which is also misnamed. The community is rightly re-using the name for the behaviour shown above. See list-t on hackage, or the implementation that comes with Pipes.