`Base.eltype(::Type{<:Alphabet})` violates `eltype` docstring
jakobnissen opened this issue · 2 comments
It states it gives the type of elements generated when iterating over the collection. But alphabets are not iterable.
Not sure how to fix this. I certainly don't want to break the shiny new interface of BioSequences. Maybe just add Base.iterate(x::Alphabet, state...) = iterate(symbols(x), state...)
?
Yes I've been thinking that Alphabet's should in a way, behave like a lazy container/set of all the symbols they permit, so Base.iterate(x::Alphabet, state...) = iterate(symbols(x), state...)
, or (symbols(x::Alphabet) = collect(x)
- chicken or egg? ^.^ ) Make sense to me.
I think the idea of an Alphabet
being a set is correct and offers some useful constructs. For example, It would be nice to be able to do issubset(symbols, alphabet)
.