IOSpec-0.2.1: A pure specification of the IO monad.Source codeContentsIndex
Test.IOSpec.Types
Contents
The IOSpec type.
Coproducts of functors
Injections from one functor to another
Description
This module contains the basic data types underlying the IOSpec library. Most of the types and classes in this module are described in http://www.cs.nott.ac.uk/~wss/Publications/DataTypesALaCarte.pdf.
Synopsis
data IOSpec f a
= Pure a
| Impure (f (IOSpec f a))
foldIOSpec :: Functor f => (a -> b) -> (f b -> b) -> IOSpec f a -> b
data (f :+: g) x
= Inl (f x)
| Inr (g x)
class (Functor sub, Functor sup) => sub :<: sup
inject :: g :<: f => g (IOSpec f a) -> IOSpec f a
The IOSpec type.
data IOSpec f a Source
A value of type IOSpec f a is either a pure value of type a or some effect, determined by f. Crucially, IOSpec f is a monad, provided f is a functor.
Constructors
Pure a
Impure (f (IOSpec f a))
show/hide Instances
foldIOSpec :: Functor f => (a -> b) -> (f b -> b) -> IOSpec f a -> bSource
The fold over IOSpec values.
Coproducts of functors
data (f :+: g) x Source
The coproduct of functors
Constructors
Inl (f x)
Inr (g x)
show/hide Instances
(f :<: g, Functor f, Functor g, Functor h) => f :<: (h :+: g)
(Functor f, Functor g) => f :<: (f :+: g)
(Functor f, Functor g) => Functor (f :+: g)
(Executable f, Executable g) => Executable (f :+: g)
Injections from one functor to another
class (Functor sub, Functor sup) => sub :<: sup Source
The (:<:) class
show/hide Instances
(f :<: g, Functor f, Functor g, Functor h) => f :<: (h :+: g)
(Functor f, Functor g) => f :<: (f :+: g)
inject :: g :<: f => g (IOSpec f a) -> IOSpec f aSource
Produced by Haddock version 2.4.2