Giter Site home page Giter Site logo

Handling aliases correctly about gradualizer HOT 4 CLOSED

josefs avatar josefs commented on June 15, 2024
Handling aliases correctly

from gradualizer.

Comments (4)

josefs avatar josefs commented on June 15, 2024

Gradualizer currently doesn't do type refinement based on patterns. So even though X is bound to a pattern which can only have the type {atom1, atom2}, Gradualizer doesn't detect this. X is given the type of the whole pattern.

I'd like Gradualizer to do more type refinement in the future, but I'm afraid it's not at the top of my todo list. If you disagree and think that this is a superimportant feature, please let me know. I might be persuaded to bump it up the list.

from gradualizer.

zuiderkwast avatar zuiderkwast commented on June 15, 2024

Shouldn't solving the constraints be enough in this case? It's not implemented, but from the pattern {atom1, _} = X, there should be a constraint X :: {atom1, _} which can be used to eliminate atom4.

from gradualizer.

josefs avatar josefs commented on June 15, 2024

@zuiderkwast, your suggestion implies that we can infer the type of the pattern. I suppose we could attempt to do that, but it's not something we currently do.

from gradualizer.

josefs avatar josefs commented on June 15, 2024

I just want to mention that I've come across this problem myself now. I didn't write the code but I've type checked a few modules which use this idiom.

from gradualizer.

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.