Get the latest tech news

Unification in Elixir


Pattern matching is a pervasive and powerful tool in Elixir. This isn't too surprising if you know a little about the history of Elixir's parent language, Erlang. Erlang was originally inspired by and written in Prolog, a logic programming language where pattern matching has first-class support. In Elixir, you might

Erlang was originally inspired by and written in Prolog, a logic programming language where pattern matching has first-class support. With a shallow walk as the first step, unification is able to navigate variable relationships incrementally, testing for equivalence and new information at each stage of the descent. Like we saw in the example of the three-way list merge, conjunction involves chaining assertions together to create a single substitution that represents joint truth.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of elixir

elixir

Photo of Unification

Unification

Related news:

News photo

Two million checkboxes (written in Elixir)

News photo

Elixir 1.17 released: set-theoretic types in patterns, durations, OTP 27

News photo

A week with Elixir (2013)