HORIZON HASKELLDocslts/ghc-10.0.x8fef28d2026-11-02Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 8fef28d · 2026-11-02

Modulenumeric-prelude-0.4.4Haskell98

Number.ResidueClass.Maybe

Synopsis
datadata T a

Here we try to provide implementations for zero and one by making the modulus optional. We have to provide non-modulus operations for the cases where both operands have Nothing modulus. This is problematic since operations like (\/) depend essentially on the modulus.

A working version with disabled zero and one can be found ResidueClass.

Constructors

Instances5Eq, Read, Show, C
  • (Eq a, C a, C a) => Eq (T a)Defined in numeric-prelude-0.4.4 · Number.ResidueClass.Maybe
  • Read a => Read (T a)Defined in numeric-prelude-0.4.4 · Number.ResidueClass.Maybe
  • Show a => Show (T a)Defined in numeric-prelude-0.4.4 · Number.ResidueClass.Maybe
  • (Eq a, C a) => C (T a)Defined in numeric-prelude-0.4.4 · Number.ResidueClass.Maybe
  • (Eq a, C a) => C (T a)Defined in numeric-prelude-0.4.4 · Number.ResidueClass.Maybe
value(/:) :: C a => a -> a -> T a

r /: m is the residue class containing r with respect to the modulus m

valuelift2 :: Eq a => (a -> a -> a -> a) -> (a -> a -> a) -> T a -> T a -> T a
#