Weird concept thrown around by functional programming purists.
Basically, it is:
Your monad type is Wrap
.
Your data type is Foo
.
Your resulting type is Wrap{Foo}
(or whatever notation you understand better).
Also known as return or unit.
Your data type is Foo
, and your data object is foo
.
return foo
results in wfoo
of type Wrap{Foo}
Also known as bind or join.
You have wfoo
of type Wrap{Foo}
.
You have a function f
that takes Foo
and returns Wrap{Bar}
wfoo >>= f
results in wbar
of type Wrap{Bar}
Basically, invalid/failure/other is captured during both unwrapping and processing and preserved in the result. You deal with it later.