3 ms·
How does this improve on the Interpreter pattern? [1] [1] https://en.wikipedia.org/wiki/Interpreter_pattern https://en.wikipedia.org/wiki/Interpreter_pattern
by skybrian 11y ago
How does this improve on the Interpreter pattern? [1]
[1] https://en.wikipedia.org/wiki/Interpreter_pattern https://en.wikipedia.org/wiki/Interpreter_pattern
- tel 11y agoIt's related. One way to see monads (but don't take this for a tutorial or the "one true way" or anything like that) is as a special data type which captures the binding structure of a language. They have good "generic" structure and the "free" monad is the expression of that generality showing how you can factor the "binding" bit and the "effectful" bit apart. The interpreter pattern is huuuge. There are so many ways to use it. Free monads take one fruitful corner and show you a highly natural way o organize and exploit it.