How to define Macro for a new Type?

Probably. Mutually recursive types however may well be difficult to do with this.

A lot of macro work. I’d start with the Metaprogramming Elixir book.

As an aside though: I’d seriously consider looking at Gleam. It’s a BEAM language w/ static types. If you want to push forward the boundaries of what will be possible with types on the BEAM I imagine that work in that ecosystem is going to be more fruitful than attempting to make it work in Elixir. If Jose tried to make it work and failed, I would think long and hard about taking it on yourself.

1 Like