Run IO actions lazily while respecting their order
|Version on this page:||0.1.0.4|
|LTS Haskell 20.15:||0.1.0.4@rev:1|
|Stackage Nightly 2023-03-22:||0.1.0.4@rev:1|
|Latest on Hackage:||0.1.0.4@rev:1|
This version can be pinned in stack with:
Module documentation for 0.1.0.4
Run IO actions lazily while respecting their order. Running a value of the LazyIO monad in the IO monad is like starting a thread which is however driven by its output. That is, the LazyIO action is only executed as far as necessary in order to provide the required data.
The package may help you to avoid stack overflows in
Say you have
mapM f xs
xs is a long list. When run, you may encounter a stack overflow.
To prevent it, write instead:
import qualified System.IO.Lazy as LazyIO LazyIO.run $ mapM (LazyIO.interleave . f) xs
The stack overflow is gone.