forked from iluwatar/java-design-patterns
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
all index.md files renamed to README.md for more compatibility with g…
…ithub
- Loading branch information
Showing
71 changed files
with
34 additions
and
34 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,35 @@ | ||
--- | ||
layout: pattern | ||
title: Monad | ||
folder: monad | ||
permalink: /patterns/monad/ | ||
categories: Other | ||
tags: | ||
- Java | ||
- Difficulty-Advanced | ||
- Functional | ||
--- | ||
|
||
## Intent | ||
|
||
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 | ||
basing on the 'same type' contract. Formally, monad consists of a type constructor M and two | ||
operations: | ||
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. | ||
|
||
![alt text](./etc/monad.png "Monad") | ||
|
||
## Applicability | ||
|
||
Use the Monad in any of the following situations | ||
|
||
* when you want to chain operations easily | ||
* when you want to apply each function regardless of the result of any of them | ||
|
||
## Credits | ||
|
||
* [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) | ||
--- | ||
layout: pattern | ||
title: Monad | ||
folder: monad | ||
permalink: /patterns/monad/ | ||
categories: Other | ||
tags: | ||
- Java | ||
- Difficulty-Advanced | ||
- Functional | ||
--- | ||
|
||
## Intent | ||
|
||
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 | ||
basing on the 'same type' contract. Formally, monad consists of a type constructor M and two | ||
operations: | ||
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. | ||
|
||
![alt text](./etc/monad.png "Monad") | ||
|
||
## Applicability | ||
|
||
Use the Monad in any of the following situations | ||
|
||
* when you want to chain operations easily | ||
* when you want to apply each function regardless of the result of any of them | ||
|
||
## Credits | ||
|
||
* [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) | ||
* [Monad on Wikipedia](https://en.wikipedia.org/wiki/Monad_(functional_programming)) |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.