Git Product home page Git Product logo

Comments (5)

Simn avatar Simn commented on June 20, 2024

I also think we need such a type. It shouldn't be named Either because that's a nice name for an enum (which we should add to haxe.ds too by the way). Something like EitherType or TypeChoice would be better.

A selection of multiple types can be achieved through nesting already, so that shouldn't be a concern.

from hxnodejs.

nadako avatar nadako commented on June 20, 2024

A selection of multiple types can be achieved through nesting already, so that shouldn't be a concern.

That would look quite ugly. But then again, one could do their own @:genericBuild-powered Either<Rest> abstract.

from hxnodejs.

nadako avatar nadako commented on June 20, 2024

I've added the EitherType type in the js.node package for now. But I guess it makes sense to move it into the std lib?

from hxnodejs.

Simn avatar Simn commented on June 20, 2024

I'm in favor of having it in the standard library, it's really convenient for externs. Maybe we could even find a way to restrict it to externs if that's a concern.

from hxnodejs.

nadako avatar nadako commented on June 20, 2024

Changed hxnodejs to use haxe.EitherType

from hxnodejs.

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.