Comments (6)
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.
For better or worse, the ternary logic including missing
is part of the semantics of ==
.
from julia.
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.
But it seems like we should actually have
==
returnmissing
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.
If
==((;f1,g1)::ComposedFunction, (;f2,g2)::ComposedFunction) = f1 == f2 && f2 == g2
, then this should returnmissing
. 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.
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)
- Consider dropping bfloat16 demotion pass HOT 1
- "Inferrable" `stdin` for use with trimmed programs
- `@test`'s use of kwargs is confusing and limits extensibility HOT 1
- Julia fails to build on a clean system due to memory error (in curl?) HOT 5
- Allow uplo='F' for Symmetric and Hermitian wrappers? HOT 2
- Shipped Windows binaries with new codesigning need `.ji` checksums updated HOT 3
- Emit OSC 9;9 escape sequences on Windows HOT 1
- Ambiguous behavior of Tuple constructor with mismatched array length HOT 2
- RetentionParameterEstimator hits incorrect assert in emit_masked_bits_compare
- Monorepo Packages via Submodules/Subpackages: Support in Pkg and Julia Compiler HOT 14
- Circular dependency detected for Symbolics.jl on Julia 1.11.0-rc2 HOT 6
- [REPL] Autocompletion of `ModuleName.@macro_name` is broken
- [REPL] Autocompletion of `@benchmark A .= A setup=(A=` is broken
- Deadlock doing I/O on a foreign thread while the main thread is blocked HOT 5
- `Conditional` lattice element is semantically broken in the presence of SSAValues HOT 1
- `Base.summarysize(::Symbol)` returns zero
- Mention accuracy of `Base.summarysize` in docstring
- `__init__` side effects order is not defined, such that any global effects from `__init__` are a data race HOT 3
- Very long (>10-20 minutes) silent pre-compilation when `using` a package with circular (extension) dependencies
- Add tests about layout of Int128
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from julia.