From 31a0620da3db0e7111e3c004ea1dcca09c55af14 Mon Sep 17 00:00:00 2001 From: Marek Kaluba Date: Fri, 7 May 2021 18:16:58 +0200 Subject: [PATCH] add literal_pow(^, s::GSymbol, ::Val{-1}) = inv(s) --- src/symbols.jl | 1 + 1 file changed, 1 insertion(+) diff --git a/src/symbols.jl b/src/symbols.jl index bd69a09..e964df8 100644 --- a/src/symbols.jl +++ b/src/symbols.jl @@ -9,6 +9,7 @@ Base.length(s::GSymbol) = first(size(s)) Base.eltype(s::GS) where GS<:GSymbol = GS Base.isone(s::GSymbol) = iszero(s.pow) +Base.literal_pow(::typeof(^), s::Groups.GSymbol, ::Val{-1}) = inv(s) Base.inv(s::GSymbol) = change_pow(s, -s.pow) Base.hash(s::S, h::UInt) where S<:GSymbol = hash(s.id, hash(s.pow, hash(S, h)))