From e717f05f07b543ee6cfba06baea298b5fa9319e2 Mon Sep 17 00:00:00 2001 From: Ian Hofmann-Hicks Date: Wed, 1 Mar 2017 21:47:24 -0800 Subject: [PATCH] add state skeleton --- docs/crocks/State.md | 81 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 docs/crocks/State.md diff --git a/docs/crocks/State.md b/docs/crocks/State.md new file mode 100644 index 000000000..325bc7de2 --- /dev/null +++ b/docs/crocks/State.md @@ -0,0 +1,81 @@ +# State + +`State s a` / `Pair p => State s (p a s)` + +-- + +-- + +```js +-- +``` + +`State` exposes the following functions on the constructor and instance: + +| Constructor | Instance | +|:---|:---| +| [`get`](#get), [`gets`](#gets), [`modify`](#modify), [`of`](#of), [`put`](#put), [`type`](#type) | [`ap`](#ap), [`chain`](#chain), [`evalWith`](#evalWith), [`execWith`](#execWith), [`inspect`](#inspect), [`map`](#map), [`of`](#of), [`runWith`](#runWith), [`type`](#type) | + +## Constructor + +### get + +`State m => () -> m s s` + +### gets + +`State m => (s -> a) -> m s a` + +### modify + +`State m, Unit u => (s -> t) -> m t u` + +### of + +`State m => a -> m s a` + +### put + +`State m, Unit u => t -> m t u` + +### type + +`() -> String` + +## Instance + +### ap + +`State m => m s (a -> b) ~> m s a -> m s b` + +### chain + +`State m => m s a ~> (a -> m s b) -> m s b` + +### evalWith + +`State m => m s a ~> s -> a` + +### execWith + +`State m => m s a ~> s -> s` + +### inspect + +`() -> String` + +### map + +`State m => m s a ~> (a -> b) -> m s b` + +### of + +`State m => a -> m s a` + +### runWith + +`State m, Pair p => m s a ~> s -> p a s` + +### type + +`() -> String`