3 ms·
Also, a Monad is not a "thing", it's a property of a thing. "Monad" is a typeclass, not a type. What follows is that Monads are not containers; you don't sto
by jrockway 17y ago
Also, a Monad is not a "thing", it's a property of a thing. "Monad" is a typeclass, not a type.
What follows is that Monads are not containers; you don't store a value in your Monad, you store it in your List. The List just happens to be a monad. (Similarly, you can't store a ball inside your "Red", but you can store it in a "Red Box". The fact that the box is red has nothing to do with its ability to be a container. If you paint a piece of paper red, it does not suddenly become a container.)
(Side note: it happens that Monads are Functors, and Functors are logically containers... but remember, the Monad or Functor instance is not what makes something a container; something is a container because of its underlying type. "Monad" is a property possessed by certain containers, just as "Red" is a property possessed by certain other containers. Oh, and please don't make me insert a joke about Red/Black trees here...)
Put simply; Monad = adjective, not Monad = noun. It took me like two years to come to terms with this, but now that I have, Haskell is one of the easiest-to-use programming languages I know.
- jamesbritt 17y ago"Also, a Monad is not a 'thing', it's a property of a thing. "Monad" is a typeclass, not a type. What follows is that Monads are not containers;" Thanks for this observation, however you (in your comment) and everyone else uses the word "monad" as a noun. Hence much confusion. "The List just happens to be a monad. " Why not say "The List just happens to be monadic", rather than saying it is a monad?
- jrockway 17y agoThanks for this observation, however you (in your comment) and everyone else uses the word "monad" as a noun. Hence much confusion. I agree with you here 100%. I was confused for years for this exact reason. I tried avoiding the noun form for a while, but the problem is that while it's technically correct, nobody "in the know" quite understands what you are talking about. "Why didn't he just call it a Monad?" Why not say "The List just happens to be monadic", rather than saying it is a monad? I should have.
- ionfish 17y agoDoesn't predication usually work this way? "Socrates is a mortal" makes just as much sense as "Socrates is mortal". The former is extensional, the latter intensional.