Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- class KnownNat (n :: Nat)
- class KnownNat p => Prime p
- type family KnownPrime p where ...
- type family IsPrime p where ...
- type family Log2 (a :: Natural) :: Natural where ...
- value :: forall n. KnownNat n => Natural
- type (<=) (x :: t) (y :: t) = Assert (x <=? y) (LeErrMsg x y :: Constraint)
- type family (a :: Natural) * (b :: Natural) :: Natural where ...
- type family (a :: Natural) + (b :: Natural) :: Natural where ...
- type family (a :: Natural) - (b :: Natural) :: Natural where ...
- type family (a :: Natural) ^ (b :: Natural) :: Natural where ...
Documentation
This class gives the integer associated with a type-level natural. There are instances of the class for every concrete literal: 0, 1, 2, etc.
Since: base-4.7.0.0
class KnownNat p => Prime p Source #
Instances
Prime BLS12_381_Base Source # | |
Defined in ZkFold.Base.Algebra.EllipticCurve.BLS12_381 | |
Prime BLS12_381_Scalar Source # | |
Defined in ZkFold.Base.Algebra.EllipticCurve.BLS12_381 | |
Prime Ed25519_Base Source # | |
Defined in ZkFold.Base.Algebra.EllipticCurve.Ed25519 | |
Prime Ed25519_Scalar Source # | |
Defined in ZkFold.Base.Algebra.EllipticCurve.Ed25519 | |
(KnownNat p, KnownPrime p) => Prime p Source # | |
Defined in ZkFold.Base.Algebra.Basic.Number |
type family KnownPrime p where ... Source #
KnownPrime p = If (IsPrime p) (() :: Constraint) (TypeError (NotPrimeError p)) |
type family Log2 (a :: Natural) :: Natural where ... #
Log base 2 (round down) of natural numbers.
Log 0
is undefined (i.e., it cannot be reduced).
Since: base-4.11.0.0
type (<=) (x :: t) (y :: t) = Assert (x <=? y) (LeErrMsg x y :: Constraint) infix 4 #
Comparison (<=) of comparable types, as a constraint.
Since: base-4.16.0.0
type family (a :: Natural) * (b :: Natural) :: Natural where ... infixl 7 #
Multiplication of type-level naturals.
Since: base-4.7.0.0
type family (a :: Natural) + (b :: Natural) :: Natural where ... infixl 6 #
Addition of type-level naturals.
Since: base-4.7.0.0