lazyio: Run IO actions lazily while respecting their order

[ bsd3, control, library, monads ] [ Propose Tags ]

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.

Modules

[Index]

Flags

Automatic Flags
NameDescriptionDefault
splitbase

Choose the new smaller, split-up base package.

Enabled
buildtests

Build test executables

Disabled

Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info

Downloads

Note: This package has metadata revisions in the cabal description newer than included in the tarball. To unpack the package including the revisions, use 'cabal get'.

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 0.0.1, 0.0.2, 0.0.3, 0.0.3.1, 0.0.3.2, 0.0.3.3, 0.1, 0.1.0.1, 0.1.0.2, 0.1.0.3, 0.1.0.4
Change log CHANGES
Dependencies base (>=1.0 && <5), special-functors (>=1.0 && <1.1), transformers (>=0.2 && <0.7), unsafe (>=0.0 && <0.1) [details]
License BSD-3-Clause
Author Henning Thielemann <haskell@henning-thielemann.de>
Maintainer Henning Thielemann <haskell@henning-thielemann.de>
Revised Revision 1 made by HenningThielemann at 2023-02-16T12:04:34Z
Category Monads, Control
Home page http://www.haskell.org/haskellwiki/Lazy_IO
Source repo head: darcs get http://code.haskell.org/~thielema/lazyio/
this: darcs get http://code.haskell.org/~thielema/lazyio/ --tag 0.1.0.4
Uploaded by HenningThielemann at 2016-12-14T21:16:25Z
Distributions LTSHaskell:0.1.0.4, NixOS:0.1.0.4, Stackage:0.1.0.4
Reverse Dependencies 4 direct, 4 indirect [details]
Executables test
Downloads 8838 total (38 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2016-12-14 [all 1 reports]