Hey Thomas, do you have a specific use case in mind to check that a module implements a behaviour? The fact that you can do this today by getting the module attributes makes me lean towards not adding this to the standard library, but I'm curious as to that's the use case you're thinking of :)
Andrea On Sun, May 17, 2020 at 10:41 AM Thomas J. <[email protected]> wrote: > Hello, > > What do you think about adding `implements?/2`? > > It accepts two module names as parameters, and it checks if the first > parameter implements the behaviour passed as the second parameter. > > It would execute something like: > > `Enum.member?(Foo.module_info[:attributes][:behaviour], Bar)` > > Only problem I see is that a module can somehow implement a behaviour > without wriring the @behaviour statement. But that could be a documented > limitation. > > > -- > You received this message because you are subscribed to the Google Groups > "elixir-lang-core" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/elixir-lang-core/12b5fbff-7460-44c1-81c1-b6710949738e%40googlegroups.com > <https://groups.google.com/d/msgid/elixir-lang-core/12b5fbff-7460-44c1-81c1-b6710949738e%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "elixir-lang-core" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/CAM9Rf%2BKEGbUswZQyATVKGB8TutMQY2oiQ%2BKTH8Qhb3HNOThVEg%40mail.gmail.com.
