finite-field-0.9.0: Finite Fields

Copyright(c) Masahiro Sakai 2013-2014
LicenseBSD-style
Maintainermasahiro.sakai@gmail.com
Stabilityprovisional
Portabilitynon-portable (ScopedTypeVariables, MultiParamTypeClasses, DeriveDataTypeable, TemplateHaskell, BangPatterns)
Safe HaskellNone
LanguageHaskell2010

Data.FiniteField.PrimeField

Contents

Description

Finite field of prime order p, Fp = Z/pZ.

References:

Synopsis

Documentation

data PrimeField p Source #

Finite field of prime order p, Fp = Z/pZ.

NB: Primality of p is assumed, but not checked.

Instances

KnownNat p => Bounded (PrimeField p) Source # 
KnownNat p => Enum (PrimeField p) Source # 
Eq (PrimeField p) Source # 

Methods

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

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

KnownNat p => Fractional (PrimeField p) Source # 
KnownNat p => Num (PrimeField p) Source # 
Ord (PrimeField p) Source # 
KnownNat p => Read (PrimeField p) Source # 
Show (PrimeField p) Source # 
NFData (PrimeField p) Source # 

Methods

rnf :: PrimeField p -> () #

KnownNat p => Hashable (PrimeField p) Source # 

Methods

hashWithSalt :: Int -> PrimeField p -> Int #

hash :: PrimeField p -> Int #

KnownNat p => FiniteField (PrimeField p) Source # 

Template haskell utilities

Here is usage example for primeField:

a :: $(primeField 15485867)
a = 1

primeField :: Integer -> TypeQ Source #

Create a PrimeField type