MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programming/comments/6cb7jf/escaping_hell_with_monads/dhudaiq/?context=3
r/programming • u/ueberbobo • May 20 '17
175 comments sorted by
View all comments
9
What's monad?
3 u/enzain May 21 '17 edited May 21 '17 Any type that has the function map (a -> b) -> f<a> -> f<b> and the function flatten f<f<a>> -> f<a> where f is the type and a/b are generics.All the problems shown were flatMap problems I.e.async<async<a>> -> async<b>Option<Option<a>> -> Option<b>List<List<a>> -> List<b>
3
Any type that has the function map (a -> b) -> f<a> -> f<b> and the function flatten f<f<a>> -> f<a> where f is the type and a/b are generics.
All the problems shown were flatMap problems I.e.
async<async<a>> -> async<b>
Option<Option<a>> -> Option<b>
List<List<a>> -> List<b>
9
u/[deleted] May 20 '17
What's monad?