HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Modulenumeric-prelude-0.4.4Haskell98

Number.ResidueClass.Maybe

  • 1 type
  • 5 values
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
#