Git Product home page Git Product logo

Comments (6)

adienes avatar adienes commented on July 17, 2024 3

please, no

I think Missing should stay in its statistics corner and only propagate in statistical contexts

Imo it already propagates through far too many functions.

from julia.

nsajko avatar nsajko commented on July 17, 2024 1

For better or worse, the ternary logic including missing is part of the semantics of ==.

from julia.

adienes avatar adienes commented on July 17, 2024 1

wait, why does missing work with in the first place? it's not a function

I'd sooner special case an error path for ∘(::Missing) than make it propagate.

from julia.

jariji avatar jariji commented on July 17, 2024

But it seems like we should actually have == return missing in this case?

If ==((;f1,g1)::ComposedFunction, (;f2,g2)::ComposedFunction) = f1 == f2 && f2 == g2, then this should return missing. I don't think there's another result that makes sense.

why does missing work with in the first place? it's not a function

takes any value, it doesn't know if they're callable until it tries to call them. That's basically the julia style. If it's necessary to know statically that there's a problem then JET will detect the problem at the problem where the invalid call occurs, not where the construction occurs. Just like you can make a list of [abs, exp, missing] and it doesn't error until you try to call them.

from julia.

jw3126 avatar jw3126 commented on July 17, 2024

If ==((;f1,g1)::ComposedFunction, (;f2,g2)::ComposedFunction) = f1 == f2 && f2 == g2, then this should return missing. I don't think there's another result that makes sense.

I don't think so, && will error on missing first argument:

julia> missing && true
ERROR: TypeError: non-boolean (Missing) used in boolean context
Stacktrace:

from julia.

jariji avatar jariji commented on July 17, 2024

Ah yeah, true && missing returns missing and missing && true errors. So if the implementation is structural, the result might depend on the order in which the components are checked. ComposedFunction components have an obvious "order" to them (namely, application order), so it seems fine to implement == structurally using the application order.

I don't like the idea of introducing a special case error specifically to make sure missing doesn't propagate: Missing is the type designed for propagating missingness, after all. 🙂

If a user wants to create a collection of callables, some of which some are missing, and then them together, I think they should be able to do that, and expect the behavior to compose too, following the specifications of the components (==, ComposedFunction, and Missing), without needing to also consider a special rule that only takes effect when these three things are combined.

from julia.

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.