
2014-04-16 12:34 GMT+02:00 Ben Franksen
[...]Has nobody ever written a paper about how to extend Haskell with the few features we actually need from CPP? I think general macro replacement like CPP offers is not on the list, right? IIUC, CPP is used in Haskell libraries almost exclusively for conditional compilation. [...]
Nope: https://github.com/haskell-opengl/OpenGLRaw/blob/master/include/HsOpenGLRaw.... Perhaps some template Haskell magic might work nowadays, bug there was no TH at all when the bindings started, and I am not sure if I should tie this package to GHC. The real solution is generating the binding via the OpenGL XML spec, anyway, but I somehow have to do some real (non-Haskell) work for real money. ;-) My point is: Do we really know that conditional compilation is *the* use case? I remember that in ancient days macros were used to generate instances etc. Make things as simple as possible, but not simpler.