I don’t think the value of this question can be understated. In a world where subtyping is the only way to express parameterizing a computation over something with an interface, it becomes a difficult question to answer. If a computation is parameterized over multiple interfaces, the number of combinations that can happen grow considerably, making understanding a program difficult. Functors give one the ability to create all the combinations but the instantiations are defined at compile-time, simplifying understanding the program because all combinations that will be used have been enumerated, so there are no funny interactions between components that one didn’t realize are used together.
While Erlang obviously does not have ‘functors’. This is how my team writes Erlang. We make heavy use of behaviours and parameterized modules and instantiate the various instances. It works out really well. While our code is not bug free, the bugs themselves are almost always localized to a specific component making debugging straight forward. In most of our bugs that make it all the way to production, identifying the cause happens within the span of a few minutes of the first occurrence.
I don’t think the value of this question can be understated. In a world where subtyping is the only way to express parameterizing a computation over something with an interface, it becomes a difficult question to answer. If a computation is parameterized over multiple interfaces, the number of combinations that can happen grow considerably, making understanding a program difficult. Functors give one the ability to create all the combinations but the instantiations are defined at compile-time, simplifying understanding the program because all combinations that will be used have been enumerated, so there are no funny interactions between components that one didn’t realize are used together.
While Erlang obviously does not have ‘functors’. This is how my team writes Erlang. We make heavy use of behaviours and parameterized modules and instantiate the various instances. It works out really well. While our code is not bug free, the bugs themselves are almost always localized to a specific component making debugging straight forward. In most of our bugs that make it all the way to production, identifying the cause happens within the span of a few minutes of the first occurrence.