mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-10-14 08:18:23 +00:00
issue #335 documentation improvements
This commit is contained in:
1 parent
3e526cb5da
commit
72e08365b8
5 files changed
+77
-8
No files matched your search
+8
-2
@@ -3,17 +3,21 @@ layout: pattern
|
||||
title: Monad
|
||||
folder: monad
|
||||
permalink: /patterns/monad/
|
||||
categories: Presentation Tier
|
||||
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.
|
||||
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 takse plain type object and returns this object wrapped in a monadic value.
|
||||
|
||||

|
||||
|
||||
@@ -25,5 +29,7 @@ Use the Monad in any of the following situations
|
||||
* 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 (functional programming) on Wikipedia] (https://en.wikipedia.org/wiki/Monad_(functional_programming)
|
||||
Reference in new issue
Block a user