shorten printing of types

This commit is contained in:
Marek Kaluba 2021-12-11 13:55:31 +01:00
parent f883b5172e
commit 70bd59e9b9
No known key found for this signature in database
GPG Key ID: 8BF1A3855328FC15
1 changed files with 6 additions and 0 deletions

View File

@ -71,6 +71,9 @@ mutable struct FPGroupElement{Gr<:AbstractFPGroup,W<:AbstractWord} <: AbstractFP
new{Gr, W}(word, UInt(0), G)
end
Base.show(io::IO, ::Type{<:FPGroupElement{Gr}}) where {Gr} =
print(io, FPGroupElement, "{$Gr, …}")
word(f::AbstractFPGroupElement) = f.word
#convenience
@ -203,6 +206,9 @@ function Base.show(io::IO, G::FPGroup)
print(io, "")
end
Base.show(io::IO, ::Type{<:FPGroup{T}}) where {T} =
print(io, FPGroup, "{$T, …}")
## GSymbol aka letter of alphabet
abstract type GSymbol end