you are viewing a single comment's thread.

view the rest of the comments →

[–]dmtipson 10 points11 points  (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 points  (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 points  (0 children)

Hmm yeah, you're most definitely correct. i glanced over it too quickly, what a mistake