tweak the printing of FPGroup

This commit is contained in:
Marek Kaluba 2024-02-12 12:38:28 +01:00
parent f4d018f087
commit 6ca9497dab
No known key found for this signature in database
GPG Key ID: 8BF1A3855328FC15
1 changed files with 12 additions and 4 deletions

View File

@ -264,10 +264,18 @@ function FPGroup(
end end
function Base.show(io::IO, ::MIME"text/plain", G::FPGroup) function Base.show(io::IO, ::MIME"text/plain", G::FPGroup)
print(io, "Finitely presented group generated by:\n\t{") println(
Base.print_array(io, permutedims(gens(G))) io,
println(io, " },") "Finitely presented group generated by $(ngens(G)) element",
println(io, "subject to relations:") ngens(G) > 1 ? 's' : "",
": ",
)
join(io, gens(G), ", ", ", and ")
println(
io,
"\n subject to relation",
length(relations(G)) > 1 ? 's' : "",
)
return Base.print_array(io, relations(G)) return Base.print_array(io, relations(G))
end end