
We love all new tools! Today we devoted our blog to Elixir and everything related. What Elixir libraries you use? What about one new library to give a try? Expat is a library for creating composable pattern matchers in Elixir.
In Erlang/Elixir it’s very common to use tagged tuples to communicate between functions. For example, a function that can fail might return {:error, reason}
or {:ok, result}
.
Of course, these two element tuples are so small, that most of the time it’s better to use them as they communicate the intent they are being used for.
But, using them can help us understand the basics of how expat
works, just remember that expat
takes patterns, and is not limited to some particular data structure.
Try Expat and read the details on GitHub!