You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As discussed on Discourse, it would be nice to have !foo return a ComposedFunction, which would
allow dispatch and specialized methods for !foo
allow nicer pretty printing of !foo as "!foo" rather than as "#xx (generic function with 1 method)" (by overloading show for ComposedFunction{typeof(!)})
allow !!foo === foo
Although !foo and f ∘ g were introduced at the same time in #17155, when ∘ was subsequently updated in Julia 1.6 to return a special ComposedFunction type (#37517), the ! implementation was not correspondingly updated, which seems like an oversight.
On a related note, it would also be good to fix the ComposedFunction show method to put parentheses around operators (or other composed functions), as this is currently broken:
julia> (!) ∘ isnan
!∘ isnan
julia>!∘ isnan
ERROR: syntax:"∘" is not a unary operator
Stacktrace:
[1] top-level scope
@ none:1
Should be a fairly easy PR.
The text was updated successfully, but these errors were encountered:
As discussed on Discourse, it would be nice to have
!foo
return aComposedFunction
, which would!foo
!foo
as"!foo"
rather than as"#xx (generic function with 1 method)"
(by overloadingshow
forComposedFunction{typeof(!)}
)!!foo === foo
Although
!foo
andf ∘ g
were introduced at the same time in #17155, when∘
was subsequently updated in Julia 1.6 to return a specialComposedFunction
type (#37517), the!
implementation was not correspondingly updated, which seems like an oversight.On a related note, it would also be good to fix the
ComposedFunction
show method to put parentheses around operators (or other composed functions), as this is currently broken:Should be a fairly easy PR.
The text was updated successfully, but these errors were encountered: