std.effect
Modules
std.effect.alt |
Implementation of the Alt effect
|
std.effect.error |
Implementation of the Error effect
|
std.effect.io | |
std.effect.lift |
Implementation of the Lift effect
|
std.effect.reader |
Implementation of the Reader effect
|
std.effect.st |
Implementation of the st.State effect
|
std.effect.state |
Implementation of the State effect
|
std.effect.writer |
Implementation of the Writer effect
|
Composable effect types
Types
The Eff
monad provides composable effect via a Row
of effects (r
) and produces a value of type a
.
An effectful function a -> b
Values
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
#[implicit]
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
A generalised interface for imperatively sequencing actions
Extracts the value of type a
from an effectful computation. Can only be done once all other
effects have been eliminated from the row (leaving [| |]
as the empty effect). See each
individual effects module on how to eliminate the effect.