TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

“Monads,” huh? Bro, have you even read Leibniz?

2 点作者 markhenderson超过 8 年前

2 条评论

BillBohan超过 8 年前
I know what a monad is from Leibniz.<p>I know what a monad is in APL. (APL is the second computer language I learned, following Fortran IV.)<p>I know that &quot;Monads come out of the sky and they stand there.&quot; from Yes.<p>dictionary.com tells me that monad is<p>1. Biology.<p>any simple, single-celled organism.<p>any of various small, flagellate, colorless ameboids with one to three flagella, especially of the genus Monas.<p>2. Chemistry.<p>an element, atom, or group having a valence of one. Compare dyad (def 3), triad (def 2a).<p>3. Philosophy.<p>(in the metaphysics of Leibniz) an unextended, indivisible, and indestructible entity that is the basic or ultimate constituent of the universe and a microcosm of it.<p>(in the philosophy of Giordano Bruno) a basic and irreducible metaphysical unit that is spatially and psychically individuated.<p>any basic metaphysical entity, especially having an autonomous life.<p>4. a single unit or entity.<p>I liked this article. It was well-written and easy to understand. I thought I might have learned something about a stumbling block which I encounter every time I try to learn what FP is about.<p>coolsunglasses then says that the article is all wrong but gives very little information about what FP monads really are.<p>&gt; It&#x27;s a useful pattern that can be reified in a sufficiently expressive type system.<p>Is that not usually called a template?<p>All of my programs were functional. If they didn&#x27;t function, I would not have been paid.
coolsunglasses超过 8 年前
&gt;small functions that lift types from simple to complex.<p>That&#x27;s not what Monad is.<p>Monad isn&#x27;t core to FP, but it&#x27;s a convenient way to express some common things in functional programs.<p>&gt;In the Haskell language, and many other modern languages, the definition is more complex. Here, a monad is also function, but it is a special type of function. Monads typically “lift” a primitive variable types (Integer, String, etc), to more complex types (MutableString, NullableInt).<p>This is completely wrong.<p>&gt;we can define the Haskell monads as that which takes one singular state and outputs another.<p>This is also wrong.<p>&gt;Thus, we can arrive at a definition of the computer science monad as a fundamental unit of computation.<p>It&#x27;s not at all fundamental to computation. It&#x27;s a useful pattern that can be reified in a sufficiently expressive type system.<p>There&#x27;s no relationship between Leibniz monads and the Monad you see in FP. Sorry.