I think I worded my question poorly, but anyways, the docs clearly explain how to do what I want…
(defguard) creates a macro that can be used both inside or outside guards.
defmodule Foo do
defguard bar(m) when is_map(m) and m.field == true
end
iex> require Foo
iex> Foo.bar(%{field: true})
true
I just needed to read more better… ![]()






















