| Copyright | (c) 2016 Andrew Lelechenko |
|---|---|
| License | MIT |
| Maintainer | Andrew Lelechenko <andrew.lelechenko@gmail.com> |
| Stability | Provisional |
| Portability | Non-portable (GHC extensions) |
| Safe Haskell | None |
| Language | Haskell2010 |
Math.NumberTheory.UniqueFactorisation
Description
An abstract type class for unique factorisation domains.
Synopsis
- type family Prime (f :: *) :: *
- class UniqueFactorisation a where
Documentation
type family Prime (f :: *) :: * #
Type of primes of a given unique factorisation domain.
abs (unPrime n) == unPrime n must hold for all n of type Prime t
Instances
| type Prime Int # | |
Defined in Math.NumberTheory.Primes.Types | |
| type Prime Integer # | |
Defined in Math.NumberTheory.Primes.Types | |
| type Prime Natural # | |
Defined in Math.NumberTheory.Primes.Types | |
| type Prime Word # | |
Defined in Math.NumberTheory.Primes.Types | |
| type Prime GaussianInteger # | |
Defined in Math.NumberTheory.UniqueFactorisation | |
| type Prime (Prefactored a) # | |
Defined in Math.NumberTheory.Prefactored | |
class UniqueFactorisation a where #
The following invariant must hold for n /= 0:
abs n == abs (product (map (\(p, k) -> unPrime p ^ k) (factorise n)))
The result of factorise should not contain zero powers and should not change after multiplication of the argument by domain's unit.
Instances
| UniqueFactorisation Int # | |
| UniqueFactorisation Integer # | |
| UniqueFactorisation Natural # | |
| UniqueFactorisation Word # | |
| UniqueFactorisation GaussianInteger # | |
Defined in Math.NumberTheory.UniqueFactorisation Methods unPrime :: Prime GaussianInteger -> GaussianInteger # factorise :: GaussianInteger -> [(Prime GaussianInteger, Word)] # isPrime :: GaussianInteger -> Maybe (Prime GaussianInteger) # | |
| UniqueFactorisation a => UniqueFactorisation (Prefactored a) # | |
Defined in Math.NumberTheory.Prefactored Methods unPrime :: Prime (Prefactored a) -> Prefactored a # factorise :: Prefactored a -> [(Prime (Prefactored a), Word)] # isPrime :: Prefactored a -> Maybe (Prime (Prefactored a)) # | |