4 ms·
Because these languages lack a way of discussing something at the right "higher order" as Monads. You can implement them, but there's no word for the kind of th
by tel 10y ago
Because these languages lack a way of discussing something at the right "higher order" as Monads. You can implement them, but there's no word for the kind of thing a monad is. There's not even a real word for a type.
You need types. Then you need "higher order types" or parameterized types. Then you need a way to discuss a common set of operations which appear repeatedly for some of these parameterized types and it can't be OO-like.
You can exemplify the operations in, e.g., Lisp, but you have a hard time "talking about" the thing.
---
In Scheme, monads are the answer to the following question:
The functions (define (pure a) (list a)) and (define (join ls) (foldl append (list) ls)) are related to lists in the same way that (define (pure a) (lambda (k) (k a))) and (define (join z) (lambda (k) ((z k) k))) is related to CPS-transformed programs. What is the commonality?
- deleted 10y ago[deleted]
- jnordwick 10y ago> is related to CPS-transformed programs. What is the commonality? ?? Even when I understand the code (Scheme at least this time), never ask a Haskell person to explain something. There is something genetic that causes them to drop into overly academic descriptions.
- vertex-four 10y agoThe issue is that Haskell is inherently a language in which you're not programming anything that maps particularly well to the machine you're actually running it on. As a result, Haskell developers never actually talk in terms of what a program does on the machine, they talk in terms of what it does in their abstract model of computation.
- tel 10y agoOn the other hand, what I'm talking about could apply to many different machine models.
- tel 10y agoThis is sort of what I'm getting at, though. Haskell gives you the language to talk fluently about everything I was writing. If you use it enough it becomes second nature and these kinds of higher order concepts are easy. Monads are easy. In languages which lack the tools to make it easy to talk about this stuff it's hard to say these things without sounding like a loon. The only reason I sound academic is that the simple language I'm used to using has been denied.