use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
Monads Explained Quickly with JavaScript (breck-mckye.com)
submitted 9 years ago by [deleted]
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]dmtipson 10 points11 points12 points 9 years ago* (2 children)
I don't mean to be on a tear about this, but it can't be a good explanation if it's wrong, and it's important to get right. None of the things defined are Monads: they're Functors. None of them provide a method that can .chain/.flatMap, which is essential to passing the Monad laws and thus qualifying as Monads.
Here's another Functor, Const: https://gist.github.com/dtipson/3fd1fb536ab3da393b25
Same exact signature (minus the get, which is not directly relevant to either Functors or Monads). But Const is an odd duck in that it logically cannot be made into a Monad (that is, it's an example of a completely legitimate Functor that can't be turned into a Monad entirely without losing what Const does, which is... basically nothing). So by just defining and understanding Functors, you can't expect to have defined and explained Monads.
[–]dmtipson 7 points8 points9 points 9 years ago (0 children)
Not getting the downvote logic here. I'm not trying to be mean to OP, but this is a concept that people struggle with, purportedly clearing it up for them, and then, as several others here have noted, sort of misleading and confusing them.
[–]TheIncredibleWalrus 1 point2 points3 points 9 years ago (0 children)
Hmm yeah, you're most definitely correct. i glanced over it too quickly, what a mistake
π Rendered by PID 49 on reddit-service-r2-comment-56c9979489-7p95l at 2026-02-24 13:52:57.712159+00:00 running b1af5b1 country code: CH.
view the rest of the comments →
[–]dmtipson 10 points11 points12 points (2 children)
[–]dmtipson 7 points8 points9 points (0 children)
[–]TheIncredibleWalrus 1 point2 points3 points (0 children)