From 49dfd4c3af1b9783c4750a52b97a28f38b8e3d51 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Thu, 5 Dec 2024 10:32:00 +0100 Subject: [PATCH] Add generic dispatch for ideal_type --- src/Ideal.jl | 4 ++++ src/exports.jl | 1 + 2 files changed, 5 insertions(+) diff --git a/src/Ideal.jl b/src/Ideal.jl index aa70290202..e2f7f60a97 100644 --- a/src/Ideal.jl +++ b/src/Ideal.jl @@ -41,3 +41,7 @@ end iszero(I::Ideal) = all(iszero, gens(I)) base_ring_type(::Type{<:IdealSet{T}}) where T <: RingElement = parent_type(T) + +# fundamental interface, to be documented +ideal_type(x) = ideal_type(typeof(x)) +ideal_type(T::DataType) = throw(MethodError(ideal_type, (T,))) diff --git a/src/exports.jl b/src/exports.jl index 992f2dd18a..11dbc97cb6 100644 --- a/src/exports.jl +++ b/src/exports.jl @@ -260,6 +260,7 @@ export hooklength export howell_form export howell_form_with_transformation export ideal +export ideal_type export identity_map export identity_matrix export image