3 ms·
You might want to look at Template Haskell, which is used for macros in Haskell (a language which already makes heavy use of higher-order functions). One nice
by chriswarbo 4y ago
You might want to look at Template Haskell, which is used for macros in Haskell (a language which already makes heavy use of higher-order functions).
One nice thing I've used macros for is reading and parsing files at compile-time, to bake-in data into programs. That way, the compiled programs just process stdio, without having to care about file paths, permission errors, parse errors, etc. (those all become compile errors)