Skip to content

Trait implementation specialization and coherence (intermediate/advanced) #16

Description

@caspark

Trait implementation specialization is a proposed and partially implemented technique for overriding part or all of an implementation of a trait with a specialized implementation for more specific types.

It's interesting because it enables some of the code reuse benefits typically ascribed to inheritance (I can see similarities to Java 8's default methods on interfaces approach as well as Scala's trait mixin + override keyword approach - perhaps comparing & contrasting to that or to C++ approaches would be good?), because it breaks parametricity somewhat, because it changes the coherence rules (restrictions around where & what implementations of a trait can be defined), and of course because it allows increased performance through specialized implementations.

If you've read this far and started opening up tabs to figure this stuff out (or already know the topic), please share your findings in the form of a talk!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions