In Elixir, is there any way to get a module to list its functions?

Each module in Elixir defines an __info__ function you can call to get information about that module.

According the Elixir Docs, 1.6.6 e.g., you can pass it :functions to get a list of functions that module contains.

Map.__info__(:functions)

[delete: 2, drop: 2, equal?: 2, fetch: 2, fetch!: 2, from_struct: 1, get: 2,
 get: 3, has_key?: 2, keys: 1, merge: 2, merge: 3, new: 0, pop: 2, pop: 3,
 put: 3, put_new: 3, size: 1, split: 2, take: 2, to_list: 1, update: 4,
 update!: 3, values: 1]

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)