std.effect

Modules

std.effect.alt
std.effect.error
std.effect.lift
std.effect.reader
std.effect.st
std.effect.state
std.effect.writer

Types

type Eff r a = 
    | Pure a
    | Impure (r x) (x -> Eff r a)

type Arr r a b = a -> Eff r b

Values

let functor : forall r . Functor (Eff r)

A Functor represents an action on a parameterized type which does not change the structure with the mapped type.

The following laws should hold:

  • map id == id
  • map (f << g) == map f << map g

let applicative : forall r . Applicative (Eff r)

A Functor with application.

The following laws should hold:

  • wrap id <*> v = v
  • wrap (<<) <> u <> v <> w = u <> (v <*> w)
  • wrap f <*> wrap x = wrap (f x)
  • u <> wrap y = wrap (\g -> g x) <> u

let monad : forall r . Monad (Eff r)

A generalised interface for imperatively sequencing actions

let run_pure eff : forall a . Eff [||] a -> a