Skip to content

Allow term embeddings for typeclass instances #12

Description

@RobinWebbers

Right now, we allow term embeddings for anything with a TH.Name. This excludes typeclass methods: their definition has a name but not their instance. We should have some syntax to permit a user to override a typeclass method. On the implementation side, it is not super trivial as the function also does not directly have a name inside of the evaluator either. We should probably instead adjust the DFunId to have contain the new method instead? I guess this doesn't propagate to other DFunIds already in the code though? Perhaps the DFunId should be part of the substitution environment and we can first lookup there before we check the unfolding. Probably depends on #4 as this changes code here quite a bit!

Activity

  1. RobinWebbers commented on Oct 16, 2026

    @RobinWebbers
    MemberAuthor

    The lookup for variables (including dictionaries) would first go through the global environment as per #9. We can insert the new dictionary identifiers in there for the modification!

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

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions