| Copyright | (c) Masahiro Sakai 2013-2014 |
|---|---|
| License | BSD-style |
| Maintainer | masahiro.sakai@gmail.com |
| Stability | provisional |
| Portability | non-portable (ScopedTypeVariables, MultiParamTypeClasses, DeriveDataTypeable, TemplateHaskell, BangPatterns) |
| Safe Haskell | None |
| Language | Haskell2010 |
Data.FiniteField.PrimeField
Contents
Description
Synopsis
- data PrimeField (p :: Nat)
- toInteger :: PrimeField p -> Integer
- primeField :: Integer -> TypeQ
Documentation
data PrimeField (p :: Nat) Source #
Finite field of prime order p, Fp = Z/pZ.
NB: Primality of p is assumed, but not checked.
Instances
Template haskell utilities
Here is usage example for primeField:
a :: $(primeField 15485867) a = 1
primeField :: Integer -> TypeQ Source #
Create a PrimeField type