christopheradams/elixir_style_guide
Best practice: How and where to put protocols and their implementation?
开放
#84 创建于 2016年4月5日
discussionenhancementhelp wantedquestion
仓库指标
- 星标
- (4,429 个星标)
- PR 合并指标
- (30 天内没有已合并 PR)
描述
I think it would help to have a common place to put protocol definitions and also implementations. It would be in particular interesting if protocols are implemented for existing modules.
For discussion:
definition:
file: lib/protocols/incredible.ex
implementation for a new modules within the module.
implementation for an existing module (e.g. Integer) in:
file: lib/protocols/impl/integer.ex
or
file: lib/protocols/integer_impl.ex
?