The signature of flatMap is something like this:<p><pre><code>    flatMap[M,A,B](cc: M[A], f: A =&gt; M[B]): M[B]
</code></pre>
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 <i>context</i>. For example M[A] could be a function of type S =&gt; (A, S). And then you could map and flatMap on such functions to produce other functions. This is the &quot;state monad&quot; btw.