<story><title>Swift Functors, Applicatives, and Monads in Pictures</title><url>http://mokacoding.com/blog/functor-applicative-monads-in-pictures</url></story><parent_chain><item><author>jbooth</author><text>Follow-on question, are there any useful monadic constructs &lt;i&gt;not&lt;/i&gt; tied to collections (including optional as you said)?</text></item><item><author>dragonwriter</author><text>&amp;gt; flatMap is really tied to List&lt;p&gt;Its tied to &lt;i&gt;collections&lt;/i&gt;, not specifically to List. A number of (but certainly not all!) important monads are (or can be viewed as) collections, including Optional&amp;#x2F;Maybe (which can be viewed as a collection with cardinality restricted to being either 0 or 1.)</text></item><item><author>jerf</author><text>Honest question: Is there a reason &amp;#x27;flatmap&amp;#x27; is any better other than it is what you learned it as somewhere?&lt;p&gt;I&amp;#x27;m not convinced English has a word or convenient phrase for &amp;quot;monad&amp;quot;, and it doesn&amp;#x27;t strike me that &amp;quot;flatMap&amp;quot; is it. How do I &amp;quot;flatMap&amp;quot; Haskell&amp;#x27;s STM monad? Or a probability monad? (I know the mechanics of the answer, I am specifically referring to the English-induced intution.) I don&amp;#x27;t see the intuition being particularly correct; flatMap is really tied to List, which isn&amp;#x27;t a particularly great thing to be tied to since it isn&amp;#x27;t very used. List&amp;#x27;s monadic interface is cute for some little algorithms, sure, which makes it disproportionately appear in examples, but list&amp;#x27;s monad implementation has complexity O(m^n) (where m is the size of the lists and n the number of lists you&amp;#x27;re going to consider) and you need some algorithm that gives you some &lt;i&gt;serious&lt;/i&gt; culling on that before it&amp;#x27;s practical for very much.</text></item><item><author>skybrian</author><text>If functional languages had called them the Mappable, Applicable, and FlatMappable interfaces, and used map(), apply(), and flatMap() instead of operators, it would have avoided a lot of confusion. But I guess that&amp;#x27;s how you avoid success at all costs.</text></item></parent_chain><comment><author>dragonwriter</author><text>IO, State, Parsers, and STM are useful monads for which the collection metaphor doesn&amp;#x27;t seem to be particularly helpful.</text></comment>
<story><title>Swift Functors, Applicatives, and Monads in Pictures</title><url>http://mokacoding.com/blog/functor-applicative-monads-in-pictures</url></story><parent_chain><item><author>jbooth</author><text>Follow-on question, are there any useful monadic constructs &lt;i&gt;not&lt;/i&gt; tied to collections (including optional as you said)?</text></item><item><author>dragonwriter</author><text>&amp;gt; flatMap is really tied to List&lt;p&gt;Its tied to &lt;i&gt;collections&lt;/i&gt;, not specifically to List. A number of (but certainly not all!) important monads are (or can be viewed as) collections, including Optional&amp;#x2F;Maybe (which can be viewed as a collection with cardinality restricted to being either 0 or 1.)</text></item><item><author>jerf</author><text>Honest question: Is there a reason &amp;#x27;flatmap&amp;#x27; is any better other than it is what you learned it as somewhere?&lt;p&gt;I&amp;#x27;m not convinced English has a word or convenient phrase for &amp;quot;monad&amp;quot;, and it doesn&amp;#x27;t strike me that &amp;quot;flatMap&amp;quot; is it. How do I &amp;quot;flatMap&amp;quot; Haskell&amp;#x27;s STM monad? Or a probability monad? (I know the mechanics of the answer, I am specifically referring to the English-induced intution.) I don&amp;#x27;t see the intuition being particularly correct; flatMap is really tied to List, which isn&amp;#x27;t a particularly great thing to be tied to since it isn&amp;#x27;t very used. List&amp;#x27;s monadic interface is cute for some little algorithms, sure, which makes it disproportionately appear in examples, but list&amp;#x27;s monad implementation has complexity O(m^n) (where m is the size of the lists and n the number of lists you&amp;#x27;re going to consider) and you need some algorithm that gives you some &lt;i&gt;serious&lt;/i&gt; culling on that before it&amp;#x27;s practical for very much.</text></item><item><author>skybrian</author><text>If functional languages had called them the Mappable, Applicable, and FlatMappable interfaces, and used map(), apply(), and flatMap() instead of operators, it would have avoided a lot of confusion. But I guess that&amp;#x27;s how you avoid success at all costs.</text></item></parent_chain><comment><author>efnx</author><text>Is Maybe tied to collections? State? Reader? Cont? 
What about Eff from extensible-effects? I use these every day.</text></comment>