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)
- Autocomplete for keys of custom non-dictionary type
- Broadcast view of `Base.Experimental.Const` fails on 1.11 HOT 4
- Segfault from `NTuple{N,Base.RefValue{...}}` on Julia 1.7.1+ HOT 3
- v1.11-rc1: Using `copy!` or `.=` with `Memory` is slower than `[:] =` and `Vector` HOT 2
- `TOML.print` generates invalid TOML on stdout when the values include multiline strings HOT 1
- Function alias of `Base.Cartesian.@nif`
- 2x regression in indexing benchmarks due to 'Remove references to non opaque pointers in codegen and LLVM passes (#54853)' HOT 1
- ERROR: LoadError: UndefVarError: `UUIDs` not defined. HOT 5
- Possible improvement in memory used in storage of a `Union` of immutable structs?
- Enable opt-in recursive constant propagation
- Common code not included in optionally-generated function HOT 5
- Stack overflow during type inference HOT 8
- Regression 1.9 -> 1.10: `getproperty` 3x longer HOT 1
- [LinearAlgebra] Wrong positive definite check when performing Cholesky decomposition HOT 3
- Assertion failure inside rr causing test x86_64-linux-gnuassertrr to fail HOT 2
- Impossible values of allunique() and allequal() HOT 3
- `permute_dims` fails in edge case because of use if `1:length`
- Documentation example not behaving as displayed - behavior of "const" on immutable objects. HOT 1
- Make precise semantics of world-age increments in top-level thunks
- New precompilation crashes on Julia 1.11-rc1 HOT 7
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.