safe-lazy-io-0.1: A library providing safe lazy IO features.Source codeContentsIndex
System.IO.Lazy.Input.Internals
Portability
Stabilityprovisional
MaintainerNicolas Pouillard <nicolas.pouillard@gmail.com>
Contents
Finalized values
Lazy inputs internals
Misc
Description
Synopsis
data Finalized a = Finally {
finalized :: a
finalizer :: IO ()
}
finalize :: Finalized (IO a) -> IO a
newtype LI a = LI {
startLI :: IO (Finalized a)
}
nonFinalized :: IO a -> LI a
finallyLI :: IO a -> IO () -> LI a
mapFinalized :: (Finalized a -> Finalized b) -> LI a -> LI b
catchEOF :: IO a -> IO a -> IO a
chanFromList :: [a] -> IO (Chan a)
rnfList :: NFData sa => [sa] -> [sa]
Finalized values
data Finalized a Source
Values with their finalizer.
Constructors
Finally
finalized :: a
finalizer :: IO ()
show/hide Instances
finalize :: Finalized (IO a) -> IO aSource
Run a finalized computation.
Lazy inputs internals
newtype LI a Source

This the type lazy input data.

Note that the lazy input type (LI) is a member of Functor, this means that one can update the contents of the input with any pure function.

LI could be a strict monad and a strict applicative functor. However it is not a lazy monad nor a lazy applicative functor as required Haskell. Hopefully it is a lazy (pointed) functor at least.

Constructors
LI
startLI :: IO (Finalized a)
show/hide Instances
nonFinalized :: IO a -> LI aSource
Build lazy input (LI) from an IO computation. Use this function when the computation does not require a finalizer.
finallyLI :: IO a -> IO () -> LI aSource
Build lazy input (LI) from an IO computation and a finalizer.
Misc
mapFinalized :: (Finalized a -> Finalized b) -> LI a -> LI bSource
Update the underlying Finalized value.
catchEOF :: IO a -> IO a -> IO aSource
x `catchEOF` y performs x and if it fails due to the EOF error then performs y.
chanFromList :: [a] -> IO (Chan a)Source
Take a list and returns a new channel the list written in it.
rnfList :: NFData sa => [sa] -> [sa]Source
This function lazily returns an element strict list. It is lazier than rnf and stricter than map (\x-> rnf x seq x).
Produced by Haddock version 2.4.2