A type for integers modulo some constant. https://github.com/TikhonJelvis/modular-arithmetic
|Latest on Hackage:||220.127.116.11|
This package is not currently in any snapshots. If you're interested in using it, we recommend adding it to Stackage Nightly. Doing so will make builds more reliable, and allow stackage.org to host generated Haddocks.
This package provides a type for integers modulo some constant, usually written as ℤ/n.
Here is a quick example:
>>> 10 * 11 :: ℤ/7 5
It also works correctly with negative numeric literals:
>>> (-10) * 11 :: ℤ/7 2
Modular division is an inverse of modular multiplication. It is defined when divisor is coprime to modulus:
>>> 7 `div` 3 :: ℤ/16 13 >>> 3 * 13 :: ℤ/16 7
- fixed a name clash with GHC.TypeLits for base >= 4.11.0
- exported the
/type operator with
ExplicitNamespacesenabled to support GHC 8. Should be backwards compatible through GHC 7.6.
- added a basic test suite with doctests
quotRemnow uses modular inversion!
invfor modular inversion
SomeModdata type for modular number with unknown modulus
someModValhelpers similar to ones in