linear-code-0.1.1: A simple library for linear codes (coding theory, error correction)

Copyright(c) Wanja Chresta 2018
LicenseGPL-3
Maintainerwanja dit hs at chrummibei dot ch
Stabilityexperimental
PortabilityPOSIX
Safe HaskellNone
LanguageHaskell2010

Math.Algebra.Field.Static

Description

Some finite field parameters are missing from HaskellForMaths implementation. Here, we add type classes to add these parameters to the type level.

Synopsis

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

Instances

type Characteristic F97 Source # 
type Characteristic F97 = 97
type Characteristic F89 Source # 
type Characteristic F89 = 89
type Characteristic F83 Source # 
type Characteristic F83 = 83
type Characteristic F79 Source # 
type Characteristic F79 = 79
type Characteristic F73 Source # 
type Characteristic F73 = 73
type Characteristic F71 Source # 
type Characteristic F71 = 71
type Characteristic F7 Source # 
type Characteristic F67 Source # 
type Characteristic F67 = 67
type Characteristic F61 Source # 
type Characteristic F61 = 61
type Characteristic F59 Source # 
type Characteristic F59 = 59
type Characteristic F53 Source # 
type Characteristic F53 = 53
type Characteristic F5 Source # 
type Characteristic F47 Source # 
type Characteristic F47 = 47
type Characteristic F43 Source # 
type Characteristic F43 = 43
type Characteristic F41 Source # 
type Characteristic F41 = 41
type Characteristic F37 Source # 
type Characteristic F37 = 37
type Characteristic F31 Source # 
type Characteristic F31 = 31
type Characteristic F3 Source # 
type Characteristic F29 Source # 
type Characteristic F29 = 29
type Characteristic F23 Source # 
type Characteristic F23 = 23
type Characteristic F2 Source # 
type Characteristic F19 Source # 
type Characteristic F19 = 19
type Characteristic F17 Source # 
type Characteristic F17 = 17
type Characteristic F13 Source # 
type Characteristic F13 = 13
type Characteristic F11 Source # 
type Characteristic (ExtensionField k poly) Source # 
type Characteristic (ExtensionField k poly) = Characteristic k

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

Instances

type PolyDegree ConwayF9 Source # 
type PolyDegree ConwayF9 = 2
type PolyDegree ConwayF8 Source # 
type PolyDegree ConwayF8 = 3
type PolyDegree ConwayF4 Source # 
type PolyDegree ConwayF4 = 2
type PolyDegree ConwayF32 Source # 
type PolyDegree ConwayF32 = 5
type PolyDegree ConwayF27 Source # 
type PolyDegree ConwayF27 = 3
type PolyDegree ConwayF25 Source # 
type PolyDegree ConwayF25 = 2
type PolyDegree ConwayF16 Source # 
type PolyDegree ConwayF16 = 4

type family Size (f :: *) :: Nat Source #

Type family which gives the size of a field, i.e. the number of elements of a finite field.

Instances

type Size (Fp p) Source # 
type Size (Fp p) = Characteristic (Fp p)
type Size (ExtensionField fp poly) Source # 
type Size (ExtensionField fp poly) = (^) (Characteristic fp) (PolyDegree poly)