API design with parameterized modules
Garrett Smith
g@REDACTED
Tue Apr 20 16:16:11 CEST 2010
The recent thread on parameterized modules is interesting. There
appear to be camps :)
Assuming that parameterized modules are here to stay (officially
supported part of the language), what does this mean for API design?
Are there any clear/obvious design guidelines that would help a
designer know when to use a parameterized module over the form of
module + state?
It seems to me that the driver would be whether the traditional
"module state" (e.g. the dict record passed around) can be divided
into a static part that doesn't change with the instantiation of the
parameterized module and a dynamic state that does.
Given that you can fairly easily include both "types" of state in a
single record, at what point does one decide to parameterize a module?
Or is this just a matter of personal style that library users will
have to adapt to?
Garrett
More information about the erlang-questions
mailing list