BSD-3-Clause licensed and maintained by Henning Thielemann
This version can be pinned in stack with:lazyio-0.1.0.4@sha256:a7a7552257632e159d52b917cb8a1a40b02a22b84e0b664389ccd8017f5b7bcd,2139

Module documentation for 0.1.0.4

Used by 1 package in nightly-2024-11-01(full list with versions):

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 mapM. Say you have

mapM f xs

where 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.