Enhance Laurent polynomial ring code and API
This concerns both LaurentPolyWrapRing and LaurentMPolyWrapRing and their elements
- [ ] rename
LaurentPolyWraptoLaurentPolyWrapRingElem(and add a type alias for backwards compatibility) - [ ] rename
LaurentMPolyWraptoLaurentMPolyWrapRingElem(and add a type alias for backwards compatibility) - [ ] ensure
change_coefficient_ringworks correctly (in particular, add tests) - [ ] add
laurent_poly_ring_typeandlaurent_mpoly_ring_typehelpers (analog todense_poly_ring_typeandmpoly_ring_type) - [ ] likewise add
laurent_poly_typeandlaurent_mpoly_type - [ ] document these helpers in
docs/src/laurent_polynomial.mdresp.docs/src/laurent_mpolynomial.md
Is removing Wrap from the type names also on the table?
Dropping Wrap would be fine by me, though then one needs to be extra careful to distinguish the concrete and the abstract types -- i.e. LaurentMPolyWrapRing would then be AbstractAlgebra.Generic.LaurentMPolyRing which is distinct from AbstractAlgebra.LaurentMPolyRing. In general I am not very happy about these types with identical names in different namespaces. In the past I've been bitten by this (when looking at at .jl file in isolation it can be difficult to tell which of the two types is being used. That's also why I greatly dislike that there is Singular.Ring which is a subtype of AbstractAlgebra.Ring. sigh)
Nevertheless, I am also for removing the Wrap.
We also have
abstract type LaurentPolyRing{T} <: AbstractAlgebra.LaurentPolyRing{T} end
@attributes mutable struct LaurentPolyWrapRing{T <: RingElement,
PR <: AbstractAlgebra.PolyRing{T}
} <: LaurentPolyRing{T}
inside Generic.. I wonder if we ever have two implementations of Laurent polynomials inside Generic.
P.S.: For polynomials we have
julia> typeof(t)
AbstractAlgebra.Generic.Poly{AbsSimpleNumFieldElem}
julia> supertype(ans)
PolyRingElem{AbsSimpleNumFieldElem}
If we did this on purpose, we could also have Generic.Laurent and LaurentRingElem, although I am not sure I like it.
How about Generic.LaurentPoly then, would be OK with me (it's an internal type in the end).
And no, I don't foresee us having other implementations; but maybe best to not draw ourselves into a corner?
Another wish (which however might be too breaking, dunno): I really wish base_ring and base_ring_type for these would return the underlying polynomial ring, not the coefficient ring... (sounds familiar? ;-) ). Alas, in this case at least we already do have coefficient_ring and coefficient_ring_type, so perhaps it'd be not too bad...