Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

predicate function negation with ComposedFunction #44752

Merged
merged 7 commits into from
Apr 12, 2022
Merged
Prev Previous commit
Update base/operators.jl
Co-authored-by: Mosè Giordano <[email protected]>
  • Loading branch information
2 people authored and vtjnash committed Apr 7, 2022
commit 5e76d7c259896d4fc4346876135729152ac728ad
2 changes: 1 addition & 1 deletion base/operators.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1083,10 +1083,10 @@ julia> filter(isletter, str)

julia> filter(!isletter, str)
"∀ > 0, ∃ > 0: |-| < ⇒ |()-()| < "
markmbaum marked this conversation as resolved.
Show resolved Hide resolved
```

!!! compat "Julia 1.9"
Starting with Julia 1.9, `!f` returns a [`ComposedFunction`](@ref) instead of an anonymous function.
```
"""
!(f::Function) = (!) ∘ f
!(f::ComposedFunction{typeof(!)}) = f.inner #allows !!f === f
StefanKarpinski marked this conversation as resolved.
Show resolved Hide resolved
Expand Down