Hmmm not sure I understand.
I like idiomatic. Does the order of the keyword matter?
If you pattern match on the keyword list then the list has to be passed in the exact same order with the exact same number of items.
These two are equivalent:
def lookup(id, place_id: "A", date: "date")
def lookup(id, [{:place_id, "A"}, {:date, "date"}])
So as @cmo says you can use Keyword.fetch/2 in the function body instead.
You can pattern match on a map in any order though, also ignoring extra keys.
Otherwise you do not have to use default arguments, you can write equivalent of the generated functions by hand by providing all the clauses. But yeah if you want to accept nil then a keyword or map would be more suited.
Now, are you sure you will use all those different combinations? If not, then maybe using functions like lookup_by_id_and_place_and_company is more direct, indeed. Only write code that you will use.






















