[Haskell-cafe] Wow Monads!

David McClain dbm at refined-audiometrics.com
Wed Apr 19 06:52:57 UTC 2017


> On Apr 18, 2017, at 22:05, MigMit <migmit at gmail.com> wrote:
> 
> http://www.offcenterdesigns.net/wp-content/uploads/wp-checkout/images/i-found-the-i-in-team-t-shirt-1344970569.jpg <http://www.offcenterdesigns.net/wp-content/uploads/wp-checkout/images/i-found-the-i-in-team-t-shirt-1344970569.jpg>
> 
> I think the problem with macros in general is that their semantics is defined purely in terms of code they generate. Not in terms of what that code actually does. As for me, I want to think about the things I need to achieve, not about the code to write.
> 

Those first two sentences were a joke, eh? Macros exist to shape the language to suit the problem domain and prevent massive typos and fingers cramping up.

I played around with Sanitary Macrology, or whatever they are called, in Dylan back in the late 90’s. Frankly, I find them maddening. I much prefer the Common Lisp style of macrology. But read up on macros in Quiennec’s book, “Lisp in Small Pieces”. They exist in a kind of no-man’s land in language stages. There really isn’t any one best kind of macrology.

Back in OCaml land they used to have a preprocessor that could give you access to the AST’s from a first pass of compiling, and I made liberal use of a custom tree rewriter in order to give my vectorized / overloaded math language NML a better shape than plain OCaml syntax. That is yet another kind of macrology. And potentially just as powerful, if less convenient to use on the fly.

- DM

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20170418/1e0035ee/attachment.html>


More information about the Haskell-Cafe mailing list