[JA] Non-Linear Pattern Matching against Unfree Data Types in Ruby (Egison Pattern Matching in Ruby)


We have designed and implemented the library that realizes non-linear pattern matching against unfree data types. We can directly express pattern-matching against lists, multisets, and sets using this library. The library is already released via as one of gems.

The expressive power of this gem derives from the theory behind the Egison programming language and is so strong that we can write poker-hands analyzer in a single pattern matching expression. This is impossible even in any other state-of-the-art programming language.

Pattern matching is one of the most important features of programming language for intuitive representation of algorithms. Our library simplifies code by replacing not only complex conditional branches but also nested loops with an intuitive pattern-matching expression.

The source code of the library is open to pubic with sample code. Please check it on GitHub.



このパターンマッチは非常に強力な表現力を持ち、例えばポーカーの役判定を行うようなプログラムを1つのパターンマッチ式で記述できます。 このようなパターンマッチは、私が設計・開発したプログラミング言語Egisonを除いて、最先端のプログラミング言語を用いても不可能です。

パターンマッチはプログラムを直感的に記述するために非常に重要なプログラミング言語の機能です。 私の開発したライブラリを使えば、複雑な条件分岐だけでなく、何重にもネストするループも、パターンマッチを用いて簡潔に記述できるようになります。


(We are planning to talk in Japanese, but slides in English.)

Recorded Video

Non-Linear Pattern Matching against Unfree Data Types in Ruby (Egison Pattern Matching in Ruby) from rubykaigi on YouTube .

Presentation Material(s)

Satoshi Egi

Rakuten Institute of Technology

A researcher working for Rakuten Institute of Technology.
The creator of the Egison programming language.
I am researching for intuitive representation of algorithms.
I can speak both English and Japanese. Please feel free to talk to me in English, too.

Tokyo, Japan