Copyright | (c) Wanja Chresta 2018 |
---|---|
License | GPL-3 |
Maintainer | wanja dit hs at chrummibei dot ch |
Stability | experimental |
Portability | POSIX |
Safe Haskell | None |
Language | Haskell2010 |
Some finite field parameters are missing from HaskellForMaths
implementation.
Here, we add type classes to add these parameters to the type level.
- type family Characteristic (f :: *) :: Nat
- char :: forall c f. (KnownNat c, c ~ Characteristic f) => Proxy f -> Int
- type family PolyDegree (f :: *) :: Nat
- type family Size (f :: *) :: Nat
Documentation
type family Characteristic (f :: *) :: Nat Source #
The characteristic of a finite field on the type level. The characteristic
is: For any element x
in the field f
with characteristic c
, we have:
c * x = x + x + .. + x (c times) = 0
type Characteristic F97 Source # | |
type Characteristic F89 Source # | |
type Characteristic F83 Source # | |
type Characteristic F79 Source # | |
type Characteristic F73 Source # | |
type Characteristic F71 Source # | |
type Characteristic F7 Source # | |
type Characteristic F67 Source # | |
type Characteristic F61 Source # | |
type Characteristic F59 Source # | |
type Characteristic F53 Source # | |
type Characteristic F5 Source # | |
type Characteristic F47 Source # | |
type Characteristic F43 Source # | |
type Characteristic F41 Source # | |
type Characteristic F37 Source # | |
type Characteristic F31 Source # | |
type Characteristic F3 Source # | |
type Characteristic F29 Source # | |
type Characteristic F23 Source # | |
type Characteristic F2 Source # | |
type Characteristic F19 Source # | |
type Characteristic F17 Source # | |
type Characteristic F13 Source # | |
type Characteristic F11 Source # | |
type Characteristic (ExtensionField k poly) Source # | |
char :: forall c f. (KnownNat c, c ~ Characteristic f) => Proxy f -> Int Source #
Characteristic of a field. It takes a finite field type in the proxy
value and gives the characteristic. This is done using type families
To support new finite field types, you need to add a type instance
for the type family Characteristic
.
type family PolyDegree (f :: *) :: Nat Source #
Type family which gives the degree of a polynomial type. This is used to
extract type level information from Extension
type PolyDegree ConwayF9 Source # | |
type PolyDegree ConwayF8 Source # | |
type PolyDegree ConwayF4 Source # | |
type PolyDegree ConwayF32 Source # | |
type PolyDegree ConwayF27 Source # | |
type PolyDegree ConwayF25 Source # | |
type PolyDegree ConwayF16 Source # | |