When designing Funx I leveraged protocols, which meant some concessions.
In Haskell, you can state class relationships like “every Monad is a Functor” (via superclass constraints). In Elixir, there isn’t an equivalent way to express that kind of protocol hierarchy. So instead of creating separate protocols and implying a relationship I can’t encode, I grouped the operations into a single protocol.
1 Like