|
|
|
|
|
by mbrock
4054 days ago
|
|
Look at the uses for Template Haskell, for example. That's basically Haskell's macro system. And it's used quite a lot, though it's kind of arcane. If you want to create an abstraction that defines one or several data types, you'll think hard about whether you can use some kind of type-level programming instead—but if that's not possible, or not convenient, you can use TH macros. For example, the `lens` package defines TH macros for creating special kinds of accessors that are tedious to write by hand. |
|