úÎ!BJ?\.      !"#$%&'()*+,-(c) 2017-2020 Andrew LelechenkoMIT/Andrew Lelechenko <andrew.lelechenko@gmail.com>None.7@AFHVXk" modThis data type represents  Bhttps://en.wikipedia.org/wiki/Modular_arithmetic#Integers_modulo_nintegers modulo m", equipped with useful instances.For example, 3 :: 3 10 stands for the class of integers congruent to 6 3 \bmod 10 \colon \ldots {}"17, "7, 3, 13, 23 \ldots :set -XDataKinds*3 + 8 :: Mod 10 -- 3 + 8 = 11 "a 1 (mod 10)(1 `modulo` 10)Warning:$ division by residue, which is not  .https://en.wikipedia.org/wiki/Coprime_integerscoprime with the modulo, throws .. Consider using  for non-prime moduli.modIThe canonical representative of the residue class, always between 0 and  m - 1  inclusively.:set -XDataKinds -1 :: Mod 10(9 `modulo` 10)modIf an argument is  .https://en.wikipedia.org/wiki/Coprime_integerscoprimeA with the modulo, return its modular inverse. Otherwise return /.:set -XDataKinds0invertMod 3 :: Mod 10 -- 3 * 7 = 21 "a 1 (mod 10)Just (7 `modulo` 10)1invertMod 4 :: Mod 10 -- 4 and 10 are not coprimeNothingmodDrop-in replacement for 0K with much better performance. Negative powers are allowed, but may throw ., if an argument is not  .https://en.wikipedia.org/wiki/Coprime_integerscoprime with the modulo.Building with -O triggers a rewrite rule 0 = .:set -XDataKinds.3 ^% 4 :: Mod 10 -- 3 ^ 4 = 81 "a 1 (mod 10)(1 `modulo` 10).3 ^% (-1) :: Mod 10 -- 3 * 7 = 21 "a 1 (mod 10)(7 `modulo` 10)/4 ^% (-1) :: Mod 10 -- 4 and 10 are not coprime(*** Exception: divide by zero1modUnboxed vectors of z cause more nursery allocations than boxed ones, but reduce pressure on garbage collector, especially for large vectors.2modUnboxed vectors of z cause more nursery allocations than boxed ones, but reduce pressure on garbage collector, especially for large vectors. mod%See the warning about division above. mod%See the warning about division above. mod%See the warning about division above. mod%See the warning about division above.8(c) 2017-2020 Andrew LelechenkoMIT/Andrew Lelechenko <andrew.lelechenko@gmail.com>None-.7@AFHMVk?% modThis data type represents  Bhttps://en.wikipedia.org/wiki/Modular_arithmetic#Integers_modulo_nintegers modulo m", equipped with useful instances.For example, 3 :: 3 10 stands for the class of integers congruent to 6 3 \bmod 10 \colon \ldots {"17}, "7, 3, 13, 23 \ldots :set -XDataKinds*3 + 8 :: Mod 10 -- 3 + 8 = 11 "a 1 (mod 10)(1 `modulo` 10)Warning:$ division by residue, which is not  .https://en.wikipedia.org/wiki/Coprime_integerscoprime with the modulo, throws .. Consider using  for non-prime moduli.modIThe canonical representative of the residue class, always between 0 and  m - 1  inclusively.:set -XDataKinds -1 :: Mod 10(9 `modulo` 10)modIf an argument is  .https://en.wikipedia.org/wiki/Coprime_integerscoprimeA with the modulo, return its modular inverse. Otherwise return /.:set -XDataKinds0invertMod 3 :: Mod 10 -- 3 * 7 = 21 "a 1 (mod 10)Just (7 `modulo` 10)1invertMod 4 :: Mod 10 -- 4 and 10 are not coprimeNothing3mod6Extended binary gcd. The second argument must be odd.4mod+ge x y returns 1 is x >= y and 0 otherwise.modDrop-in replacement for L with a bit better performance. Negative powers are allowed, but may throw ., if an argument is not  .https://en.wikipedia.org/wiki/Coprime_integerscoprime with the modulo.Building with -O triggers a rewrite rule  = .:set -XDataKinds.3 ^% 4 :: Mod 10 -- 3 ^ 4 = 81 "a 1 (mod 10)(1 `modulo` 10).3 ^% (-1) :: Mod 10 -- 3 * 7 = 21 "a 1 (mod 10)(7 `modulo` 10)/4 ^% (-1) :: Mod 10 -- 4 and 10 are not coprime(*** Exception: divide by zeromod%See the warning about division above.mod%See the warning about division above. mod%See the warning about division above.!mod%See the warning about division above.85           !"#$%&"mod-0.1.2.0-LHa6CakLkKh9OqsXjiPgMxData.Mod Data.Mod.WordPrelude^ModunMod invertMod^%$fVectorVectorMod$fMVectorMVectorMod $fUnboxMod $fPrimMod $fStorableMod $fFieldMod$fEuclideanMod$fGcdDomainMod$fFractionalMod $fRingMod $fSemiringMod$fNumMod $fBoundedMod $fEnumMod $fShowMod $fNFDataMod$fEqMod$fOrdMod $fGenericModbaseGHC.Exception.Type DivideByZero GHC.MaybeNothingGHC.RealD:R:VectorMod0D:R:MVectorsMod0invertModWordOddge