Elixir Pattern Matching on Struct Module


Elixir's Pattern Matching can also match on the Struct Module:

%struct_module{} = %User{}

struct_module # => User

Elixir just keeps doing these things that blows my mind. This kind of features is completely surprising when I discovered them but after some thoughts, it completely makes sense.

I guess this is why I love Elixir and its Pattern Matching feature so much.