How can I get Elixir to help me with generating match specifications from funs. There is an Erlang function :ets.fun2ms/1 which can do this. Sort of anyway, in that the Erlang compiler actually tranforms this to the match specification at compile time. Can I tell the Elixir compiler to do this tranformation?
There are no problems in using match specifications explicitly in Elixr of course as they are just data structures, it doing the transformation I am after.
Thanks for the suggestions. Why does the Elixir compiler disallow parse transforms?
The problm is I have another issue than just doing it from Elixir and that is I want to do it from LFE (Lisp Flavoured Erlang) as well. And there I have records which Elixir doesn’t, and these 2 packages, don’t really support. The LFE compiler makes full use of the Erlang compiler so it just translates all record operations into the record expressions in the Erlang AST.
I am also looking at doing it in a nice way using the modules in Erlang but without parse transforms, which will be the last option.