ex2ms v1.5.0 Ex2ms

This module provides the Ex2ms.fun/2 macro for translating Elixir functions to match specifications.

Summary

Functions

Translates an anonymous function to a match specification

Functions

fun(arg1) (macro)
fun(term, (any -> any)) :: :ets.match_spec

Translates an anonymous function to a match specification.

Examples

iex> Ex2ms.fun do {x, y} -> x == 2 end
[{{:"$1", :"$2"}, [], [{:==, :"$1", 2}]}]