Skip to content

Latest commit

 

History

History
87 lines (56 loc) · 785 Bytes

State.md

File metadata and controls

87 lines (56 loc) · 785 Bytes

MODULE State

State

data

constructor(readonly run: (s: S) => [A, S]) {}

Methods

ap

<B>(fab: State<S, (a: A) => B>): State<S, B>

ap_

<B, C>(this: State<S, (b: B) => C>, fb: State<S, B>): State<S, C>

chain

<B>(f: (a: A) => State<S, B>): State<S, B>

eval

(s: S): A

exec

(s: S): S

map

<B>(f: (a: A) => B): State<S, B>

state

instance

Monad2<URI>

get

function

<S>(): State<S, S>

gets

function

<S, A>(f: (s: S) => A): State<S, A>

modify

function

<S>(f: (s: S) => S): State<S, undefined>

put

function

<S>(s: S): State<S, undefined>