2 ms·
> It's not a monad defined as a specific datastructure in your language, but it is a monadic operation... IO in Haskell is exactly an effect type like 'console'
by pron 11y ago
> It's not a monad defined as a specific datastructure in your language, but it is a monadic operation... IO in Haskell is exactly an effect type like 'console' in Koka. It is monadic in Haskell, like in Koka. In Haskell it's slightly more awkward because let bindings and function application are pure so you are forced to use monad combinators (or do notation) to combine them, but this is just a syntactic difference not one of any substance
I both agree and disagree, because that very much depends on the domain. From a mathematical point of view, whenever two things are isomorphic, then they are the "same". But from a programming point of view, the two can be very different, as abstractions are psychological interactions with the programmer's mind, and two isomorphic mathematical concepts can psychologically interact very differently with the programmer. Therefore, if I don't have to "think in monads" when working with an abstraction, then the abstraction is not a monad, even if an isomorphism exists between them.
As it has been proven (I think) that any effect can be modeled by monads, you could say that all effects are monadic, and just like the mathematician in the famous joke, that's absolutely true yet absolutely useless. In a programming language, abstractions are defined (and measured) both by mathematical as well as psychological properties.
So I think the difference is of substance because it has vastly different psychological properties (more than just thin syntactic sugar).
- tome 11y ago> So I think the difference is of substance because it has vastly different psychological properties (more than just thin syntactic sugar). Right, it's not just syntactic sugar, it's also the type system, and it may also touch on the run-time system. I think we've been in violent agreement from the beginning but I just didn't realise it. I interpreted your language as being somewhat combative and that put me on the defensive.
- pron 11y ago> I interpreted your language as being somewhat combative and that put me on the defensive. I'm sorry, then, and take full responsibility. Internet culture -- at least in forums such as this -- rewards texts with emotional content more than those devoid of it. As there are many texts breathlessly extolling the virtues of monads, I had to offset that a bit ;)
- tome 11y ago> As there are many texts breathlessly extolling the virtues of monads, I had to offset that a bit ;) That is an understandable impetus ;)