Sunday, August 19, 2018

Endofunctors are containers

This is a great explanation of how endofunctors are containers:  (How are Reader is a container)

https://youtu.be/EO86S2EZssc?list=PLbgaMIhjbmEnaH_LTkxLI7FMa2HsnawM_&t=2503




I found it great for understanding Chapter 3 of the Advanced Scala with Cats book:


https://underscore.io/training/courses/advanced-scala/


Note: if this is possible then the params given to a functor are in that "functor container" AND if any abstract data type is functorial. Then, I think it follows that if you add a flatmap instance for that particular ADT that you should be able to create a monad for that ADT.   More to follow... but that is pretty cool.  Every ADT can be a monad.  So you can sequence a set of calls to a function with different values (values are the same as functors)

More on this later.

No comments: