Re:C++14: Transducers
by bad_user on Thursday December 17, 2015 @04:07AM
(#10750337)
The signature of flatMap is something like this:
So given that you respect its signature, M[A] is not necessarily a producer of values. It can be anything and it helps if you think about it not like a collection or a container, but more like a context. For example M[A] could be a function of type S => (A, S). And then you could map and flatMap on such functions to produce other functions. This is the "state monad" btw.
[ Parent
| on HN ]
There are no comments on this comment yet.