From 19570db1d1a085abd7cd83940fad5540255e6151 Mon Sep 17 00:00:00 2001 From: Kevin Lanni Date: Thu, 18 Jun 2015 22:00:39 -0700 Subject: [PATCH] monads --- readme.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/readme.md b/readme.md index 68778ce..bd50703 100644 --- a/readme.md +++ b/readme.md @@ -170,6 +170,16 @@ randIter.next(); // Each exectuion gives a random value, expression is evluated ## Monad +> A Monad is a pattern to describe computations as a series of steps. + +A monad is a "unit" function that wraps a value and produces the same value by way of a "bind" function and are sometimes referred to as "programmable semicolons" due to the fact that they represent chainable computations. + +The simplest monad is the Identity monad. It simply wraps a value. + +```js +let Identity = v => ({ bind: transform => transform(v) }) +``` + --- ## Comonad