Examples of difficult matches?

I’m wondering - does anyone have any interesting/informative examples of when
pattern matching is difficult or impractical?

E.g., keyword lists in general are hard to match…

Hal Fulton

Keyword lists are exactly my one and only pain point so far. In Benchee I do configuration with maps, as I found keyword lists just to be impractical to match against and it is MUCH MUCH nicer with maps.

If maps are too deeply nested and you match against too many values the method definition also gets a bit long-ish. Still wondering if this is still considered ok or if I’m doing something wrong/overusing pattern matching then.

ShortMaps adds a sigil to help fix that, it needs a little overhaul in my opinion though, to better support more use-cases and deep manipulation, but it helps a lot as-is.

1 Like

Wow, thank you a lot for this :slight_smile: Always wondered why that didn’t make it into Elixir and was contemplating researching if it came up before and then eventually propose it. Great to have that!