all index.md files renamed to README.md for more compatibility with github
This commit is contained in:
parent
528d179efe
commit
bd1b65276e
@ -1,35 +1,35 @@
|
|||||||
---
|
---
|
||||||
layout: pattern
|
layout: pattern
|
||||||
title: Monad
|
title: Monad
|
||||||
folder: monad
|
folder: monad
|
||||||
permalink: /patterns/monad/
|
permalink: /patterns/monad/
|
||||||
categories: Other
|
categories: Other
|
||||||
tags:
|
tags:
|
||||||
- Java
|
- Java
|
||||||
- Difficulty-Advanced
|
- Difficulty-Advanced
|
||||||
- Functional
|
- Functional
|
||||||
---
|
---
|
||||||
|
|
||||||
## Intent
|
## Intent
|
||||||
|
|
||||||
Monad pattern based on monad from linear algebra represents the way of chaining operations
|
Monad pattern based on monad from linear algebra represents the way of chaining operations
|
||||||
together step by step. Binding functions can be described as passing one's output to another's input
|
together step by step. Binding functions can be described as passing one's output to another's input
|
||||||
basing on the 'same type' contract. Formally, monad consists of a type constructor M and two
|
basing on the 'same type' contract. Formally, monad consists of a type constructor M and two
|
||||||
operations:
|
operations:
|
||||||
bind - that takes monadic object and a function from plain object to monadic value and returns monadic value
|
bind - that takes monadic object and a function from plain object to monadic value and returns monadic value
|
||||||
return - that takes plain type object and returns this object wrapped in a monadic value.
|
return - that takes plain type object and returns this object wrapped in a monadic value.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
## Applicability
|
## Applicability
|
||||||
|
|
||||||
Use the Monad in any of the following situations
|
Use the Monad in any of the following situations
|
||||||
|
|
||||||
* when you want to chain operations easily
|
* when you want to chain operations easily
|
||||||
* when you want to apply each function regardless of the result of any of them
|
* when you want to apply each function regardless of the result of any of them
|
||||||
|
|
||||||
## Credits
|
## Credits
|
||||||
|
|
||||||
* [Design Pattern Reloaded by Remi Forax](https://youtu.be/-k2X7guaArU)
|
* [Design Pattern Reloaded by Remi Forax](https://youtu.be/-k2X7guaArU)
|
||||||
* [Brian Beckman: Don't fear the Monad](https://channel9.msdn.com/Shows/Going+Deep/Brian-Beckman-Dont-fear-the-Monads)
|
* [Brian Beckman: Don't fear the Monad](https://channel9.msdn.com/Shows/Going+Deep/Brian-Beckman-Dont-fear-the-Monads)
|
||||||
* [Monad on Wikipedia](https://en.wikipedia.org/wiki/Monad_(functional_programming))
|
* [Monad on Wikipedia](https://en.wikipedia.org/wiki/Monad_(functional_programming))
|
Loading…
x
Reference in New Issue
Block a user