3 ms·
> You could pass around explicit dictionaries with all your values or some such, … if you have an extremely low-overhead way of doing so A lot of that plumbing
by kd0amg 11y ago
> You could pass around explicit dictionaries with all your values or some such, … if you have an extremely low-overhead way of doing so
A lot of that plumbing could be hidden from the user given the right dynamic features.
http://www.eighty-twenty.org/2015/01/25/monads-in-dynamically-typed-languages.html http://www.eighty-twenty.org/2015/01/25/monads-in-dynamicall...
- iheartmemcache 11y agoThis is a really, really interesting, well-written, accessible article even if you don't know the GHC or Racket internals. Thanks!
- lmm 11y agoIt sounds like racket generics are at least partway on the road to a type system. And those placeholder values seem a bit greenspunny - I'm not sure how they'd interact with native racket features (e.g. macros). (I mean, you are right, but in a degenerate sense you could implement typeclasses in any dynamic language by having your program construct strings and writing a Haskell compiler in that language that executed those strings at runtime. So the more relevant question is whether monad techniques can be used effectively in an idiomatic program).
- kd0amg 11y agoThe big difference is that generic dispatch is resolved dynamically. I haven't yet found myself reaching for monads in Racket (or writing much non-Redex Racket code) since tonyg wrote that post, so I don't know if there are any odd interactions to watch out for.