View Source Matcha.Rewrite.Kernel (Matcha v0.1.10)
Replacements for Kernel functions when rewriting Elixir into match specs.
These are versions that play nicer with Erlang's match spec limitations.
Link to this section Summary
Functions
Re-implements Kernel.and/2
.
Re-implements Kernel.is_boolean/1
.
Re-implements Kernel.is_exception/1
.
Re-implements Kernel.is_exception/2
.
Re-implements Kernel.is_struct/1
.
Re-implements Kernel.is_struct/2
.
Re-implements Kernel.or/2
.
Link to this section Functions
Re-implements Kernel.and/2
.
This ensures that Elixir 1.6.0+'s boolean optimizations don't create (disallowed) case statements inside match spec bodies.
Re-implements Kernel.is_boolean/1
.
The original simply calls out to :erlang.is_boolean/1
,
which is not allowed in match specs (as of Erlang/OTP 25).
Instead, we re-implement it in terms of things that are.
Re-implements Kernel.is_exception/1
.
This borrows the guard-specific implementation from Elixir since what Elixir wants to do in normal bodies is invalid in match specs.
Re-implements Kernel.is_exception/2
.
This borrows the guard-specific implementation from Elixir since what Elixir wants to do in normal bodies is invalid in match specs.
Re-implements Kernel.is_struct/1
.
This borrows the guard-specific implementation from Elixir since what Elixir wants to do in normal bodies is invalid in match specs.
Re-implements Kernel.is_struct/2
.
This borrows the guard-specific implementation from Elixir since what Elixir wants to do in normal bodies is invalid in match specs.
Re-implements Kernel.or/2
.
This ensures that Elixir 1.6.0+'s boolean optimizations don't create (disallowed) case statements inside match spec bodies.