strict-io-0.2.2: A library wrapping standard IO modules to provide strict IO.

System.IO.Strict.Internals

Description

This module exports the internals of System.IO.Strict so that other packages can extend the SIO monad. This module has to be used with great care: by lifting a lazy function or a function that let leaks its lazy arguments, one breaks the only purpose of the System.IO.Strict module.

Synopsis

# Types

newtype SIO a Source #

Constructors

 SIO FieldsrawRun :: IO a

Instances

 Source # Methods(>>=) :: SIO a -> (a -> SIO b) -> SIO b #(>>) :: SIO a -> SIO b -> SIO b #return :: a -> SIO a #fail :: String -> SIO a # Source # Methodsfmap :: (a -> b) -> SIO a -> SIO b #(<\$) :: a -> SIO b -> SIO a # Source # Methodsmfix :: (a -> SIO a) -> SIO a # Source # Methodspure :: a -> SIO a #(<*>) :: SIO (a -> b) -> SIO a -> SIO b #(*>) :: SIO a -> SIO b -> SIO b #(<*) :: SIO a -> SIO b -> SIO a #

# Running the SIO monad

run :: NFData sa => SIO sa -> IO sa Source #

run allows to return to the wider world of IOs.

# A stricter return

return' :: (Monad m, NFData sa) => sa -> m sa Source #

A stricter version of return, that works for every monad.

# Wrapping functions

wrap0 :: IO a -> SIO a Source #

Wraps a strict IO computation without arguments.

wrap0' :: NFData sa => IO sa -> SIO sa Source #

Wraps a lazy IO computation without arguments and forces its contents.

wrap1 :: (a -> IO b) -> a -> SIO b Source #

Wraps a strict IO computation with a single argument.

wrap1' :: NFData sb => (a -> IO sb) -> a -> SIO sb Source #

Wraps a lazy IO computation with a single argument and forces its contents.

wrap2 :: (a -> b -> IO c) -> a -> b -> SIO c Source #

Wraps a strict IO computation with two arguments.

wrap2' :: NFData sc => (a -> b -> IO sc) -> a -> b -> SIO sc Source #

Wraps a strict IO computation with two arguments and forces its contents.

wrap3 :: (a -> b -> c -> IO d) -> a -> b -> c -> SIO d Source #

Wraps a strict IO computation with two arguments.

wrap3' :: NFData sd => (a -> b -> c -> IO sd) -> a -> b -> c -> SIO sd Source #

Wraps a strict IO computation with two arguments and forces its contents.