Yuchen Zhang
Personal account
a monad is a parameterised type such as Optional and Stream in Java which:
Implements flatMap (a.k.a. bind) and unit (a.k.a. identity, return, Optional.of(), etc…).
https://gist.github.com/yc-zhang/1a78fe06e814b186f1571399b37a4005
https://gist.github.com/afcastano/e4182d344158cdbb6b65852bf67ef254#file-resultflatmap-java
Stream.of("yuchen", "chenyu")
.flatMap(s -> Stream.of("hello " + s))
.forEach(System.out::println);
How we bind?
How we unit?
https://patternsinfp.wordpress.com/2010/12/31/stream-monad/
use it to make code solid - isolate the side effects
make the code neat - describe the progress
focus method signature - just an instance method
use it everywhere - result\stream\future\business result
By Yuchen Zhang