iota-0.1.0.0
Safe HaskellSafe-Inferred
LanguageGHC2021

Data.GaloisField

Synopsis

Documentation

newtype GF (p :: Nat) Source #

Constructors

GF 

Fields

Instances

Instances details
Vector Vector (GF p) Source # 
Instance details

Defined in Data.GaloisField

Methods

basicUnsafeFreeze :: Mutable Vector s (GF p) -> ST s (Vector (GF p))

basicUnsafeThaw :: Vector (GF p) -> ST s (Mutable Vector s (GF p))

basicLength :: Vector (GF p) -> Int

basicUnsafeSlice :: Int -> Int -> Vector (GF p) -> Vector (GF p)

basicUnsafeIndexM :: Vector (GF p) -> Int -> Box (GF p)

basicUnsafeCopy :: Mutable Vector s (GF p) -> Vector (GF p) -> ST s ()

elemseq :: Vector (GF p) -> GF p -> b -> b

MVector MVector (GF p) Source # 
Instance details

Defined in Data.GaloisField

Methods

basicLength :: MVector s (GF p) -> Int

basicUnsafeSlice :: Int -> Int -> MVector s (GF p) -> MVector s (GF p)

basicOverlaps :: MVector s (GF p) -> MVector s (GF p) -> Bool

basicUnsafeNew :: Int -> ST s (MVector s (GF p))

basicInitialize :: MVector s (GF p) -> ST s ()

basicUnsafeReplicate :: Int -> GF p -> ST s (MVector s (GF p))

basicUnsafeRead :: MVector s (GF p) -> Int -> ST s (GF p)

basicUnsafeWrite :: MVector s (GF p) -> Int -> GF p -> ST s ()

basicClear :: MVector s (GF p) -> ST s ()

basicSet :: MVector s (GF p) -> GF p -> ST s ()

basicUnsafeCopy :: MVector s (GF p) -> MVector s (GF p) -> ST s ()

basicUnsafeMove :: MVector s (GF p) -> MVector s (GF p) -> ST s ()

basicUnsafeGrow :: MVector s (GF p) -> Int -> ST s (MVector s (GF p))

KnownNat p => Bounded (GF p) Source # 
Instance details

Defined in Data.GaloisField

Methods

minBound :: GF p #

maxBound :: GF p #

KnownNat p => Num (GF p) Source # 
Instance details

Defined in Data.GaloisField

Methods

(+) :: GF p -> GF p -> GF p #

(-) :: GF p -> GF p -> GF p #

(*) :: GF p -> GF p -> GF p #

negate :: GF p -> GF p #

abs :: GF p -> GF p #

signum :: GF p -> GF p #

fromInteger :: Integer -> GF p #

Read (GF p) Source # 
Instance details

Defined in Data.GaloisField

KnownNat p => Fractional (GF p) Source #
>>> recip @(GF 998244353) 0
0
>>> recip @(GF 2) 0
0
Instance details

Defined in Data.GaloisField

Methods

(/) :: GF p -> GF p -> GF p #

recip :: GF p -> GF p #

fromRational :: Rational -> GF p #

Show (GF p) Source # 
Instance details

Defined in Data.GaloisField

Methods

showsPrec :: Int -> GF p -> ShowS #

show :: GF p -> String #

showList :: [GF p] -> ShowS #

Eq (GF p) Source # 
Instance details

Defined in Data.GaloisField

Methods

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

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

Unbox (GF p) Source # 
Instance details

Defined in Data.GaloisField

IsoUnbox (GF p) Int32 Source # 
Instance details

Defined in Data.GaloisField

Methods

toURepr :: GF p -> Int32

fromURepr :: Int32 -> GF p

newtype MVector s (GF p) Source # 
Instance details

Defined in Data.GaloisField

newtype MVector s (GF p) = MV_GF (MVector s Int32)
newtype Vector (GF p) Source # 
Instance details

Defined in Data.GaloisField

newtype Vector (GF p) = V_GF (Vector Int32)

pattern GF# :: Int# -> GF p Source #

mkGF :: forall p. KnownNat p => Int -> GF p Source #

validateGF :: forall p. KnownNat p => GF p -> Bool Source #

natValAsInt :: KnownNat n => proxy n -> Int Source #

natValAsWord :: KnownNat n => proxy n -> Word Source #

reifyNat :: Integral i => i -> (forall n. KnownNat n => Proxy n -> a) -> a Source #

>>> reifyNat (998244353 :: Int) natValAsInt
998244353

asGFOf :: GF p -> Proxy p -> GF p Source #