Coder Social home page Coder Social logo

Modular implicits about broom HOT 4 OPEN

broom-lang avatar broom-lang commented on May 24, 2024
Modular implicits

from broom.

Comments (4)

nilern avatar nilern commented on May 24, 2024

This paper has all the details of a resolution algorithm. It seems to be essentially the same as our subtyping as long as the codomain of implicit functions is matched before the domain (which causes recursive resolution).

The major required change is support for backtracking; we should probably just put a Prolog 'trail' style undo stack in the typing context. That should be both easier to implement and more performant than an explicit substitution state that could be discarded immutably.

The paper also includes type well-formedness rules that ensure termination of resolution. We might eventually also want the equivalent of UndecidableInstances that just limits the resolution stack depth somewhat arbitrarily. Modular Implicits also seem to be a lot lazier about preventing nontermination.

from broom.

nilern avatar nilern commented on May 24, 2024

Also need to be able to block the resolution of an implicit whose type contains unification variables until the moment those unification variables go out of scope. This mechanism should also be useful for generativity polymorphism (related to #9).

from broom.

nilern avatar nilern commented on May 24, 2024

Actually using persistent union-find instead of a trail. Avoids complexity when undoing union operations and should only be slower by a constant factor. (Might even be faster since apparently a fast union-find might not be so fast when backtracking is required.)

from broom.

nilern avatar nilern commented on May 24, 2024

Switched to mutable union-find with backtracking.

from broom.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.