3 ms·
Monads and Turing Completeness have very little to do with each other. Unix pipes as monads is trying to create an analogy (an imprecise one) between unix pipe
by Peaker 15y ago
Monads and Turing Completeness have very little to do with each other.
Unix pipes as monads is trying to create an analogy (an imprecise one) between unix pipe operations and monadic operations. The monadic laws do not hold with unix pipes, so the analogy is pretty weak.
You might want to re-read Conal's "the c language is purely functional" because it makes no claim about cpp being a monad, at all.
Let's look at the monad instances/examples listed by the Wadler paper, in order:
* The identity monad
* The strictness monad
* The state monad
* Filters (MonadZero)
* Monad Morphisms
Under "More Monads":
* Parsers
* Exceptions
* Input and Output
Are you trying to use this paper to establish that monads were invented exclusively for I/O and now perverted to describe exceptions? Note how exceptions are listed as an example use of monads before I/O.
> and who are you to say that integers are not usefully equivalent to exceptions??? have you ever heard of errno?
errno is not an exception mechanism. You have to indicate, in-band, that there's an error result, then check for that result, and then use errno as well, to implement exceptions.
Whereas the Either monad itself implements both the in-band encoding of errors, and the caller's error-check and propagation.