I faced this problem myself a while back as well with the Solution library.
Long story short: A match can be stored as Elixir AST by wrapping it in a quote do ... end block, and these can be used as first argument to a match?, =, case or with-statement. However, because of reasons I do not understand (see here for the discussion on the Elixir issue tracker), macros in the ‘match’ position are expanded in a way that does not allow guard-expressions, even in the case of case and with that allow them to be written by hand. Which is why I ended up rolling my own scase and swith alternatives for them in the case of the Solution library.