fix conversion GSymbol → GWord

This commit is contained in:
kalmar 2017-01-25 12:18:01 +01:00
parent 6b87bf44a3
commit 885854896f
1 changed files with 2 additions and 1 deletions

View File

@ -1,6 +1,6 @@
module Groups
import Base: length, ==, hash, show
import Base: length, ==, hash, show, convert
import Base: one, inv, reduce, *, ^
export GSymbol, GWord
@ -42,6 +42,7 @@ type GWord{T<:GSymbol} <: Word
end
GWord{T<:GSymbol}(s::T) = GWord{T}([s])
convert{T<:GSymbol, W<:Word}(::Type{W}, s::T) = GWord{T}(s)
IDWord{T<:GSymbol}(::Type{T}) = GWord(one(T))
IDWord{T<:GSymbol}(W::GWord{T}) = IDWord(T)