Giter Site home page Giter Site logo

Basic type refinement about gradualizer HOT 5 CLOSED

josefs avatar josefs commented on June 15, 2024
Basic type refinement

from gradualizer.

Comments (5)

zuiderkwast avatar zuiderkwast commented on June 15, 2024 2

The title could be "Basic type refinement" or something similar. That means, excluding an atom in the union type if it matches the pattern in a previous case/function/catch/receive clause. Only when there are no guards as a first step.

Actually, I plan to work on this on Wednesday. We have "Hackathon" at work, which means Gradualizer hacking to me. :-)

from gradualizer.

erszcz avatar erszcz commented on June 15, 2024 1

I'm changing the title accordingly.

from gradualizer.

gomoripeti avatar gomoripeti commented on June 15, 2024

also related to #25

your last example is puzzling. The return type of case should be the union of the type of the clauses which should still be binary | ( string() | false ). weird and good finding.

from gradualizer.

josefs avatar josefs commented on June 15, 2024

@erszcz, you're right that this problem is related to type refinement. Unfortunately, it might take some time before we get to implement this.

That last example is weird. Feel free to add it to test/known_problems/should_fail/ so we can keep better track of it.

from gradualizer.

erszcz avatar erszcz commented on June 15, 2024

That last example is weird.

The mystery is solved. I have been tricked by Vim hiding the error indicator, but it did so, cause it couldn't parse a crash report. The problem is gone with 5e1c425 and both examples now behave the same.

The title issue, though, remains valid, but as far as I understand it's going to take a while before it gets solved.

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.