by dustingetz · 13y ago · 0 comments
here's python source to a monadic lisp interpreter, which i wrote to follow along the paper "monad transformers and modular interpreters" [1]. i think this is a much simpler implementation of python monads than provided in the ValuedLessons article. https://github.com/dustingetz/monadic-interpreter
Study of this implementation will teach you why nobody actually uses monads in python for non-toy projects. A literal port of this code to clojure would feel so much more idiomatic and not hacky at all.
here are some smaller code dumps demonstrating the fundamental concepts to that monadic lisp interpreter:
http://www.dustingetz.com/2012/10/02/reader-writer-state-mon... http://www.dustingetz.com/2012/10/07/monads-in-python-identi...
[1] http://haskell.cs.yale.edu/wp-content/uploads/2011/02/POPL96...