Hacker News new | past | comments | ask | show | jobs | submit login

I've read that synchronously executed code from a text file is actually a form of monad in itself. Is this true?



Sequences of bytes form a monad. Sequences of machine instructions form a monad. (Indeed, for any x, sequences of x form a monad). This is occasionally a useful fact (e.g. it's what tells you that you can debug an assembly program by debugging the first half, then debugging the second half starting from the state it was in at the end of the first half).

The definition of a monad is really simple - a lot of things form monads. Which is what makes them so powerful, because if you write a function that works on a generic monad, you find you can use that function for a lot of things.


Your question is meaningless as you've written it. An object equipped with a "return" and a "bind" operation is a monad if the operations follow the three monad laws of left identity, right identity and associativity.

To say whether something is a monad or not, you must first identify the object you're talking about and describe its "return" and "bind" operations.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: