3 ms·
Thats true, reflection tools like Haskell's Uniplate and SYB are very helpful. But its still possible to get very far with just ADTs if you use "parameterized f
by ufo 11y ago
Thats true, reflection tools like Haskell's Uniplate and SYB are very helpful. But its still possible to get very far with just ADTs if you use "parameterized functors" instead of recursive data types for the syntax tree and write some reusable fold functions for the walkers.
Another neat thing about this approach is that its super easy to add metadata to the syntax tree (for example, line numbers for error messages).
http://lambda-the-ultimate.org/node/4170#comment-63836 http://lambda-the-ultimate.org/node/4170#comment-63836