[erlang-questions] State of -extends(Module)?

Jesper Louis Andersen <>
Mon Oct 29 17:32:06 CET 2012

On Oct 29, 2012, at 11:46 AM, Loïc Hoguin <> wrote:

> On 10/29/2012 11:36 AM, Magnus Müller wrote:
>> In the never-ending quest of searching help to program as little as
>> possible, I found Erlang's -extends(Module) directive. There is little
>> documentation on it, which makes me believe that it is either
>> an unwanted or not well-supported feature of the language. Is this
>> correct? Would you recommend keeping away from it?
> As a general rule, keep away from anything undocumented. They are either internal code (that may change at any time) or experimental features (that may be removed at any time).
> I do not think it is used anywhere in OTP. I am not sure why it was added to the language. This looks like an experimental feature.
> There was a discussion a few weeks back on how -extends changed in a recent version and made some code incompatible. Use at your own risk.

Let me add that the dialyzer doesn't support -extends. So you have to choose between using an (undocumented) feature, which is presumably part of parameterized modules, or the dialyzer.

Jesper Louis Andersen
  Erlang Solutions Ltd., Copenhagen

More information about the erlang-questions mailing list