GithubHelp home page GithubHelp logo

Union type as ADT argument about alpaca HOT 4 CLOSED

alpaca-lang avatar alpaca-lang commented on June 27, 2024
Union type as ADT argument

from alpaca.

Comments (4)

j14159 avatar j14159 commented on June 27, 2024

I wonder if this is similar to #34 - wouldn't surprise me if we could simplify the handling of ADTs and their unification while solving both, it's a bit heavy-handed at the moment. I'm going to try to find some time to sort out #25 over the next week (I suspect it's just a case of furthering generalization) and then tackle this (unless it's already solved by then ;) )

from alpaca.

danabr avatar danabr commented on June 27, 2024

I have a prototypical fix here: master...danabr:fix/complex-types

I say "prototypical", because the code needs cleanup, and I'm not sure I should do type lookup like this. It also happens to fix the example in #34, but there are more complex ways to use aliases than that example which I'm sure will break even with this simple fix.

from alpaca.

danabr avatar danabr commented on June 27, 2024

I've updated the complex-types branch with something that works even for type aliases and type unions.

However, there is something weird going on. unify_adt expects two cells as its first arguments, but there are occasions when it gets something that is not a cell. You can see this by removing the "is_pid(C2) test and running the tests.

from alpaca.

j14159 avatar j14159 commented on June 27, 2024

Closing due to PR #49

from alpaca.

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.