I wish I could edit my messages here :) But passing a user's module to a library is really common (I had not had my first coffee yet...).
Just looking at the config file should be enough.
For example:
`config :elixir, :time_zone_database, Tz.TimeZoneDatabase`
Don't we want to make sure that the module I pass (`Tz.TimeZoneDatabase`) implements the `Calendar.TimeZoneDatabase` behaviour? And raise if that's not the case.
Or that the Repo I pass in the config is a valid Repo? Et cetera.
For example I changed in my config file module `Tz.TimeZoneDatabase` by `Foo`. And there is no error. Only when I call something like:
`DateTime.shift_zone(~U[2018-07-16 10:00:00Z], "America/Los_Angeles")`
I will get the error:
`** (UndefinedFunctionError) function Foo.time_zone_period_from_utc_iso_days/2 is undefined (module Foo is not available)`
In my library I would add a function such as `raise_unless_implements/2` to make sure that the custom module behaves as expected.
I'm now surprised that this isn't a common practice.