Discussion: Incorporating Erlang/OTP 21 map guards in Elixir

Another use case for is_map_key

defp request(integration = %{cache: cache}, path, opts) when :erlang.is_map_key({path, opts}, cache) do

But it would be better if we can use this in the future (compiling to guard calls perhaps?)

defp request(integration = %{cache: %{{path, opts} => cache}}, path, opts) do
2 Likes

Does those plans changed or they would be realized in next releases?

I can see that is_struct (for now only /1 is added and /2 would be on next release, but there is no is_exception and your example code:

also is not yet supported as of 1.10.2 version.

We are going with #1 and #3, we won’t add #2. is_exception was not implemented but a PR is welcome.

2 Likes