1
0
mirror of https://github.com/kalmarek/Groups.jl.git synced 2024-12-25 18:15:29 +01:00

fix conversion GSymbol → GWord

This commit is contained in:
kalmar 2017-01-25 12:18:01 +01:00
parent 6b87bf44a3
commit 885854896f

View File

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