4 ms·
I'm not a Lisp nor Haskell programmer though I plan to learn both. The article was quite interesting especially the part about macros. How much does lazy evalua
by grn 13y ago
I'm not a Lisp nor Haskell programmer though I plan to learn both. The article was quite interesting especially the part about macros. How much does lazy evaluation decrease the need for macros?
- audreyt 13y agoFlow-control macros often become plain functions in Haskell, thanks to a combination of lazy evaluation and monadic syntax. `while`, `for`, `or` etc are all just regular functions. That said, macros are still useful for embedding foreign language snippets as literals (e.g. XML). GHC's TemplateHaskell extension takes care of that use case; it also provides quasi-quotation facilities that turns Haskell snippets into syntax tree literals for heavy-duty metaprogramming.