The lazyio package

[Tags:bsd3, library]

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.

Properties

Versions 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.*), transformers (>=0.2 && <0.6), unsafe (==0.0.*) [details]
License BSD3
Author Henning Thielemann <haskell@henning-thielemann.de>
Maintainer Henning Thielemann <haskell@henning-thielemann.de>
Category Monads, Control
Home page http://www.haskell.org/haskellwiki/Lazy_IO
Source repository head: darcs get http://code.haskell.org/~thielema/lazyio/
this: darcs get http://code.haskell.org/~thielema/lazyio/ --tag 0.1.0.4
Uploaded Wed Dec 14 21:16:25 UTC 2016 by HenningThielemann
Distributions LTSHaskell:0.1.0.4, NixOS:0.1.0.4, Stackage:0.1.0.4, Tumbleweed:0.1.0.4
Downloads 1880 total (86 in the last 30 days)
Votes
0 []
Status Docs available [build log]
Last success reported on 2016-12-14 [all 1 reports]
Hackage Matrix CI

Modules

[Index]

Flags

NameDescriptionDefaultType
splitbaseChoose the new smaller, split-up base package.EnabledAutomatic
buildtestsBuild test executablesDisabledAutomatic

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

Downloads

Maintainer's Corner

For package maintainers and hackage trustees