IOSpec-0.3: A pure specification of the IO monad.

Safe HaskellNone
LanguageHaskell98

Test.IOSpec.Types

Contents

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

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)) 

foldIOSpec :: Functor f => (a -> b) -> (f b -> b) -> IOSpec f a -> b Source

The fold over IOSpec values.

Coproducts of functors

data (f :+: g) x infixr 5 Source

The coproduct of functors

Constructors

Inl (f x) 
Inr (g x) 

Instances

((:<:) f g, Functor f, Functor g, Functor h) => f :<: ((:+:) h g) Source 
(Functor f, Functor g) => f :<: ((:+:) f g) Source 
(Functor f, Functor g) => Functor ((:+:) f g) Source 
(Executable f, Executable g) => Executable ((:+:) f g) Source 

Injections from one functor to another

class (Functor sub, Functor sup) => sub :<: sup Source

The (:<:) class

Minimal complete definition

inj

Instances

Functor f => f :<: f Source 
((:<:) f g, Functor f, Functor g, Functor h) => f :<: ((:+:) h g) Source 
(Functor f, Functor g) => f :<: ((:+:) f g) Source 

inject :: g :<: f => g (IOSpec f a) -> IOSpec f a Source