galois-field-0.2.0: Galois field library

Safe HaskellNone
LanguageHaskell2010

PrimeField

Synopsis

Documentation

data PrimeField (p :: Nat) Source #

Prime fields GF(p) for p prime

Instances
Eq (PrimeField p) Source # 
Instance details

Defined in PrimeField

Methods

(==) :: PrimeField p -> PrimeField p -> Bool #

(/=) :: PrimeField p -> PrimeField p -> Bool #

KnownNat p => Fractional (PrimeField p) Source #

Prime fields are fields

Instance details

Defined in PrimeField

KnownNat p => Num (PrimeField p) Source #

Prime fields are rings

Instance details

Defined in PrimeField

Show (PrimeField p) Source # 
Instance details

Defined in PrimeField

Generic (PrimeField p) Source # 
Instance details

Defined in PrimeField

Associated Types

type Rep (PrimeField p) :: Type -> Type #

Methods

from :: PrimeField p -> Rep (PrimeField p) x #

to :: Rep (PrimeField p) x -> PrimeField p #

KnownNat p => Random (PrimeField p) Source #

Prime fields are random

Instance details

Defined in PrimeField

Methods

randomR :: RandomGen g => (PrimeField p, PrimeField p) -> g -> (PrimeField p, g) #

random :: RandomGen g => g -> (PrimeField p, g) #

randomRs :: RandomGen g => (PrimeField p, PrimeField p) -> g -> [PrimeField p] #

randoms :: RandomGen g => g -> [PrimeField p] #

randomRIO :: (PrimeField p, PrimeField p) -> IO (PrimeField p) #

randomIO :: IO (PrimeField p) #

KnownNat p => Arbitrary (PrimeField p) Source #

Prime fields are arbitrary

Instance details

Defined in PrimeField

Bits (PrimeField p) Source # 
Instance details

Defined in PrimeField

NFData (PrimeField p) Source # 
Instance details

Defined in PrimeField

Methods

rnf :: PrimeField p -> () #

KnownNat p => Pretty (PrimeField p) Source #

Prime fields are pretty

Instance details

Defined in PrimeField

Methods

pretty :: PrimeField p -> Doc #

prettyList :: [PrimeField p] -> Doc #

KnownNat p => GaloisField (PrimeField p) Source #

Prime fields are Galois fields

Instance details

Defined in PrimeField

type Rep (PrimeField p) Source # 
Instance details

Defined in PrimeField

type Rep (PrimeField p) = D1 (MetaData "PrimeField" "PrimeField" "galois-field-0.2.0-3YqrqBLHAyQCDpm2BPwSMp" True) (C1 (MetaCons "PF" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Integer)))

toInt :: PrimeField p -> Integer Source #

Embed to integers