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

Safe Haskell | Safe-Inferred
Language | Haskell98

Test.IOSpec

Contents

- The specifications
- The basic types
- The virtual machine

Synopsis

- module Test.IOSpec.Fork
- module Test.IOSpec.MVar
- module Test.IOSpec.IORef
- module Test.IOSpec.STM
- module Test.IOSpec.Teletype
- data ((f :: Type -> Type) :+: (g :: Type -> Type)) x
  - = Inl (f x)
  - | Inr (g x)
- data IOSpec (f :: Type -> Type) a
- inject :: forall g (f :: Type -> Type) a. g :<: f => g (IOSpec f a) -> IOSpec f a
- class (Functor sub, Functor sup) => (sub :: Type -> Type) :<: (sup :: Type -> Type)
- module Test.IOSpec.VirtualMachine

# The specifications

module Test.IOSpec.Fork

module Test.IOSpec.MVar

module Test.IOSpec.IORef

module Test.IOSpec.STM

module Test.IOSpec.Teletype

# The basic types

data ((f :: Type -> Type) :+: (g :: Type -> Type)) x infixr 5 Source #

The coproduct of functors

Constructors

Inl (f x) |
Inr (g x) |

#### Instances

Instances details

(Functor f, Functor g) => f :<: (f :+: g) Source # |
Instance details Defined in Test.IOSpec.Types Methods inj :: f a -> (f :+: g) 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
(Executable f, Executable g) => Executable (f :+: g) Source # |
Instance details Defined in Test.IOSpec.VirtualMachine Methods step :: (f :+: g) a -> VM (Step a) Source #
(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 Source # (<$) :: a -> (f :+: g) b -> (f :+: g) a Source #

data IOSpec (f :: Type -> Type) 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

Instances details

Functor f => Applicative (IOSpec f) Source # |
Instance details Defined in Test.IOSpec.Types Methods pure :: a -> IOSpec f a Source # (<*>) :: IOSpec f (a -> b) -> IOSpec f a -> IOSpec f b Source # liftA2 :: (a -> b -> c) -> IOSpec f a -> IOSpec f b -> IOSpec f c Source # (*>) :: IOSpec f a -> IOSpec f b -> IOSpec f b Source # (<*) :: IOSpec f a -> IOSpec f b -> IOSpec f a Source #
Functor f => Functor (IOSpec f) Source # |
Instance details Defined in Test.IOSpec.Types Methods fmap :: (a -> b) -> IOSpec f a -> IOSpec f b Source # (<$) :: a -> IOSpec f b -> IOSpec f a Source #
Functor f => Monad (IOSpec f) Source # |
Instance details Defined in Test.IOSpec.Types Methods (>>=) :: IOSpec f a -> (a -> IOSpec f b) -> IOSpec f b Source # (>>) :: IOSpec f a -> IOSpec f b -> IOSpec f b Source # return :: a -> IOSpec f a Source #

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

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

The (:<:) class

Minimal complete definition

inj

#### Instances

Instances details

Functor f => f :<: f Source # |
Instance details Defined in Test.IOSpec.Types Methods inj :: f a -> f a
(Functor f, Functor g) => f :<: (f :+: g) Source # |
Instance details Defined in Test.IOSpec.Types Methods inj :: f a -> (f :+: g) 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

# The virtual machine

module Test.IOSpec.VirtualMachine