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

Safe HaskellSafe
LanguageHaskell98

Test.IOSpec

Contents

Synopsis

The specifications

The basic types

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

The (:<:) class

Minimal complete definition

inj

Instances
Functor f => f :<: f Source # 
Instance details

Defined in Test.IOSpec.Types

Methods

inj :: f a -> f a

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

Defined in Test.IOSpec.Types

Methods

inj :: f a -> (h :+: g) a

(Functor f, Functor g) => f :<: (f :+: g) Source # 
Instance details

Defined in Test.IOSpec.Types

Methods

inj :: f a -> (f :+: g) a

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 # 
Instance details

Defined in Test.IOSpec.Types

Methods

inj :: f a -> (h :+: g) a

(Functor f, Functor g) => f :<: (f :+: g) Source # 
Instance details

Defined in Test.IOSpec.Types

Methods

inj :: f a -> (f :+: g) a

(Functor f, Functor g) => Functor (f :+: g) Source # 
Instance details

Defined in Test.IOSpec.Types

Methods

fmap :: (a -> b) -> (f :+: g) a -> (f :+: g) b #

(<$) :: a -> (f :+: g) b -> (f :+: g) a #

(Executable f, Executable g) => Executable (f :+: g) Source # 
Instance details

Defined in Test.IOSpec.VirtualMachine

Methods

step :: (f :+: g) a -> VM (Step a) Source #

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.

Instances
Functor f => Monad (IOSpec f) Source # 
Instance details

Defined in Test.IOSpec.Types

Methods

(>>=) :: IOSpec f a -> (a -> IOSpec f b) -> IOSpec f b #

(>>) :: IOSpec f a -> IOSpec f b -> IOSpec f b #

return :: a -> IOSpec f a #

fail :: String -> IOSpec f a #

Functor f => Functor (IOSpec f) Source # 
Instance details

Defined in Test.IOSpec.Types

Methods

fmap :: (a -> b) -> IOSpec f a -> IOSpec f b #

(<$) :: a -> IOSpec f b -> IOSpec f a #

Functor f => Applicative (IOSpec f) Source # 
Instance details

Defined in Test.IOSpec.Types

Methods

pure :: a -> IOSpec f a #

(<*>) :: IOSpec f (a -> b) -> IOSpec f a -> IOSpec f b #

liftA2 :: (a -> b -> c) -> IOSpec f a -> IOSpec f b -> IOSpec f c #

(*>) :: IOSpec f a -> IOSpec f b -> IOSpec f b #

(<*) :: IOSpec f a -> IOSpec f b -> IOSpec f a #

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

The virtual machine