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,” huh? Bro, have you even read Leibniz?

2 pointsby markhendersonover 8 years ago

2 comments

BillBohanover 8 years ago
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.
coolsunglassesover 8 years ago
&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.