Re:So You Want to Write Your Own Language (2014)
by quchen on Friday May 19, 2017 @02:39PM
(#14378280)
The key insight is that all languages have monads, but very few have monad. It’s up to the programmer to see the pattern in e.g. Javascript. But other than having higher kinds there’s not much that keeps most languages from having them the same way e.g. Haskell has.
The »plain monad« part was directed at Javascript, not Haskell. Haskell, like JS, can work perfectly fine without monads, but it still works perfectly fine with them ;-)
Re:So You Want to Write Your Own Language (2014)
by KirinDave on Friday May 19, 2017 @02:47PM
(#14378348)
How did Haskell do IO effects before monadic computation? I ask because any such influence predates my exposure to the ecosystem.
Re:So You Want to Write Your Own Language (2014)
by dietrichepp on Friday May 19, 2017 @04:11PM
(#14378971)
http://stackoverflow.com/questions/17002119/haskell-pre-mona...
main :: [Response] -> [Request]
I don't really see what you're saying here. I didn't mean to equivocate the structures except in terms of their "alien-ness".
But Monads are "special", in that literally everyone uses them but almost never sees them from the "outside" unless they're using a language that offers techniques to model them. Writing Javascript? You're in a monad with helper tools of a specific type. Writing C? Same deal, different shapes.
Lisp Macros do something different (and I alluded to this with the "meta-syntactic" mention), but similarly change the thought process from "how do I write this logic" to "how do I describe this logic".
> . I’m not even sure the plain »monad« concept even exists as an abstraction instead of in docstrings.
Since they are annihilated in the Haskell runtime as well that shouldn't be terribly surprising. It's a modeling technique to build programs algebraically. It's like asking if Generics exist at runtime. They do inasmuch as they are relevant to the interpretation of the program.