TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Monads Are Not Metaphors (2010)

71 pointsby ckarmannover 9 years ago

9 comments

GreaterFoolover 9 years ago
Did bad high-school mathematics education conditioned us all to hate everything that&#x27;s related to mathematics?<p>Label a concept &quot;this is just engineering practice&quot; or &quot;this is just physics. this equation describes how universe works&quot; and people will happily accept it as is.<p>But label it &quot;mathematics&quot; and explanations are in order because maths is hard to understand...<p>I don&#x27;t see any posts where authors concern themselves with metaphors for Maxwell&#x27;s equations (or anything else in physics; maybe I&#x27;m hanging out in the wrong circles though).<p>What is a process of understanding a mathematical equation? Stare at it until you grok it? Use it to solve problems to get a feel of what it means? Write proofs about it so you can state some properties with certainty?<p>I don&#x27;t know what the best&#x2F;structured process is, but the core is &quot;take this equation and do something with it&quot;.<p>Do the same with monads! I think people having problems understanding monads are those that defer writing any code until they feel &quot;they get it&quot;. Instead of &quot;now I get it, monads are burritos, time to write some code&quot; one should write some code <i>in order to understand monads</i>
评论 #10196869 未加载
评论 #10198457 未加载
评论 #10197638 未加载
评论 #10199023 未加载
评论 #10199403 未加载
评论 #10199996 未加载
评论 #10199208 未加载
TuringTestover 9 years ago
This coming from the &quot;you don&#x27;t really understand a topic until you learn its maths&quot; school. I don&#x27;t mind that position as there&#x27;s some truth to it, up until they commit the mistake to consider metaphors harmful and an obstacle.<p>I greatly benefited from the &quot;conveyor belt&quot; metaphor for learning monads; it made me grasp instantly something that I would have never understood from a pure theoretical explanation - namely <i>why</i> they are so useful and widespread in functional programming, as a building tool to distribute logic among several composable functions over a data type. Sentences like &quot;We start with one thing and use its value to compute a new thing&quot; and &quot;Monads are an abstract, mathematical label affixed to a pattern found in almost all code&quot; will never convey information about how it&#x27;s intended to be used in the same vivid way as the metaphor.<p>I know for true that the pure mathematical approach leaves me hanging. I learned linear algebra in the theorem-proof style, and as of today I still don&#x27;t know when it&#x27;s an adequate technique to use. I can&#x27;t tell what matrix ranks, kernels or tensors are good for even though I can calculate their values very precisely.
评论 #10198326 未加载
orkodenover 9 years ago
<a href="http:&#x2F;&#x2F;fuckingmonads.com" rel="nofollow">http:&#x2F;&#x2F;fuckingmonads.com</a>
crimsonalucardover 9 years ago
Anybody who didn&#x27;t know what monads were and now reached an epiphany thanks to this article please comment.<p>Also is there anyone here who understands what monads are but has never programmed in haskell or a functional language?
评论 #10197787 未加载
评论 #10196722 未加载
评论 #10200020 未加载
评论 #10196637 未加载
wyagerover 9 years ago
This article seems a bit heavy on the computational monads.<p>Monads don&#x27;t necessarily have anything to do with sequencing or computation, and the author is objectively incorrect to say &quot;monads are a pattern, not a specific type&quot;. In fact, monads are an algebraic structure, defined only by the types of the operations defined on them and the laws those operations obey.<p>That&#x27;s not to say that concrete examples like the one here aren&#x27;t useful, but the author is not covering the full scope of what monads are.
a3nover 9 years ago
Brushing aside &quot;you can do anything in one language that you can in another,&quot; what do monads allow me to do <i>better</i> that I can only approach without them?<p>I&#x27;ve tried reading (but not coding), and all I hear is sequence of operations, chaining, and similar. I know I&#x27;m missing something.<p>Basically I haven&#x27;t seen or synthesized the tl;dr that makes me want to learn a language that has them.
评论 #10199202 未加载
评论 #10199448 未加载
评论 #10199240 未加载
olavkover 9 years ago
Metaphors a tricky. Reminds me of the many attempts to explain objects and classes in terms of real-world object. (Cars, fruits, persons etc.) These explanations are often more confusing than enlightening, since object and classes are actually not like real world objects at all.
评论 #10196711 未加载
评论 #10197221 未加载
saurikover 9 years ago
Related:<p><a href="https:&#x2F;&#x2F;byorgey.wordpress.com&#x2F;2009&#x2F;01&#x2F;12&#x2F;abstraction-intuition-and-the-monad-tutorial-fallacy&#x2F;" rel="nofollow">https:&#x2F;&#x2F;byorgey.wordpress.com&#x2F;2009&#x2F;01&#x2F;12&#x2F;abstraction-intuiti...</a>
runnigover 9 years ago
Could someone translate this to Python?