@@ -493,12 +493,17 @@ IndexLens(::Tuple{Properties}) = Properties()
493493# ## nice show() for optics
494494_shortstring (prev, o:: PropertyLens{field} ) where {field} = " $prev .$field "
495495_shortstring (prev, o:: IndexLens ) = " $prev [$(join (repr .(o. indices), " , " )) ]"
496- _shortstring (prev, o:: Union{Function,Type} ) = _isoperator (o) ? " $o $prev " : " $o ($prev )"
497- _shortstring (prev, o:: Base.Fix1 ) = _isoperator (o. f) ? " $(o. x) $(o. f) $prev " : " $(o. f) ($(o. x) , $prev )"
498- _shortstring (prev, o:: Base.Fix2 ) = _isoperator (o. f) ? " $prev $(o. f) $(o. x) " : " $(o. f) ($prev , $(o. x) )"
496+ _shortstring (prev, o:: Union{Function,Type} ) = _isoperator (o) ? " $( _fT_repr (o)) $prev " : " $( _fT_repr (o)) ($prev )"
497+ _shortstring (prev, o:: Base.Fix1 ) = _isoperator (o. f) ? " $(o. x) $(_fT_repr ( o. f)) $prev " : " $(_fT_repr ( o. f) ) ($(o. x) , $prev )"
498+ _shortstring (prev, o:: Base.Fix2 ) = _isoperator (o. f) ? " $prev $(_fT_repr ( o. f)) $(o. x) " : " $(_fT_repr ( o. f) ) ($prev , $(o. x) )"
499499_shortstring (prev, o:: Elements ) = " $prev [∗]"
500500_shortstring (prev, o:: Properties ) = " $prev [∗ₚ]"
501501
502+ # compact representation of functions and types
503+ # most notably, it deals with the module name in a consistent way: doesn't show it
504+ # by default, it's not shown for functions but shown for types, see https://github.com/JuliaLang/julia/issues/56790
505+ _fT_repr (o) = repr (o; context= :compact => true )
506+
502507# can f be stringfied using the operator (infix) syntax?
503508# otherwise uses regular function call syntax
504509_isoperator (f:: Function ) = Base. isoperator (nameof (f))
0 commit comments