|
System.IO.Strict | Stability | provisional | Maintainer | Nicolas Pouillard <nicolas.pouillard@gmail.com> |
|
|
|
|
|
Description |
This module wraps the functions of the System.IO module at a different type namely SIO.
The purpose of this module is to export only strict IO functions, by strict
we mean strict in the result. The arguments of these functions may only by partially forced,
but when the function returns, the arguments can no longer be forced by the function.
When the type of the value to be forced is polymorphic, a NFData constraint is added
since we (internally) use rnf to force the value. Then we rely on the behavior
of NFData instances to provide the fact that any lazy argument passed to a SIO function
will not leak-out after the call.
These functions do not necessarily use their arguments completely but they do not hold
or return any value that could depend on these arguments. If the original functions
from System.IO module were already strict, then this module just provides them
at another type.
Some functions from the original module are famously lazy like the getContents like
functions: in this module their results are deeply forced.
In Haskell, monad operations (return and >>=) have to be lazy. Therefore the SIO
monad is not completely strict (i.e. pure values can still be lazy). So in this module we
expose the return' function that forces the given value before putting it into the monad.
Since this module uses the same names as System.IO, it is designed to be imported qualified.
import System.IO.Strict (SIO)
import qualified System.IO.Strict as SIO
|
|
Synopsis |
|
|
|
|
Types
|
|
|
Instances | |
|
|
|
run allows to return to the wider world of IOs.
|
|
|
A stricter version of return, that works for every monad.
|
|
Functions stricter than there System.IO counterparts
|
|
|
Note that getContents is stricter than its counterpart in System.IO.
|
|
|
Note that hGetContents is stricter than its counterpart in System.IO.
|
|
|
Note that readFile is stricter than its counterpart in System.IO.
|
|
|
Note that read is stricter than its counterpart in System.IO.
|
|
|
Note that readLn is stricter than its counterpart in System.IO.
|
|
|
Note that fix is stricter than its counterpart in System.IO.
|
|
|
Note that withBinaryFile is stricter than its counterpart in System.IO.
|
|
|
Note that withFile is stricter than its counterpart in System.IO.
|
|
Functions as strict as there System.IO counterparts
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Produced by Haddock version 2.6.0 |