christopheradams/elixir_style_guide

Best practice: How and where to put protocols and their implementation?

開放

#84 建立於 2016年4月5日

 (8 則留言) (0 個反應) (0 位負責人)Elixir (300 個分叉)batch import
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

?

貢獻者指南