|Posted by Bill Baxter|
in reply to Pau D. Anderson
Posted in reply to Pau D. Anderson
Pau D. Anderson wrote:
> Bill Baxter Wrote:
>> Hmm, so would it be correct to say that monad is just another way to say 'impure function'? It sounds like that's all you're saying. So just like we're going to have 'pure' to isolate the functional code in D, functional languages have 'impure' functions that isolate the procedural/stateful stuff. They just happen to give those impure functions a ridiculous name.
>> Seriously why on earth are they called 'monads'? Sounds like it derives from "mono" meaning "one", like "triad" is a group of three things. So 'monad' should mean a group of one thing I would thing. Yet it means "impure function". Really odd. I hate it when people give things terrible non-descriptive names. But maybe there's a rational explanantion?
> According to an online dictionary the word derives from the Latin monas as you surmised. I think the meaning is more along the lines of unified or indivisible rather than the number one:
> Philosophy. An indivisible, impenetrable unit of substance viewed as the basic constituent element of physical reality in the metaphysics of Leibnitz.
> Biology. A single-celled microorganism, especially a flagellate protozoan of the genus Monas.
> Chemistry. An atom or a radical with valence 1.
> [Latin monas, monad-, unit, from Greek, from monos, single.]
> Aren't elements in lisp called atoms?
> According to another online source, Epicurus called the indivisible bits that made up the world "monads" while Democritus famously called them "atoms". (In ancient Greek, of course. English wasn't invented for at least twenty years after Epicurus.)
> So "monad" is just another word for "atom", a synonym used for the specifiic meaning above, I guess.
Sweet! Now *that* is making some sense.
Ok, so a monad contains impure state, but it is something indivisible & impenetrable so that you cannot access that impure state.