cifl-math-library-1.1.1.0: Math libraries
Safe HaskellSafe-Inferred
LanguageHaskell2010

Math.Number.TypeRational

Documentation

data SNat Source #

Constructors

Ze 
Su SNat 
SNegate SNat 

data SBin Source #

Constructors

SBZe 
SBOne SBin 
SBZero SBin 

data Sing :: SNat -> * where Source #

Constructors

SNatZ :: Sing 'Ze 
SNatS :: Sing s -> Sing ('Su s) 

Instances

Instances details
SingInteger (Sing x) => SingInteger (Sing ('Su x)) Source # 
Instance details

Defined in Math.Number.TypeRational

Methods

singToInteger :: Sing ('Su x) -> Integer Source #

SingInteger (Sing 'Ze) Source # 
Instance details

Defined in Math.Number.TypeRational

type family Half (n :: SNat) = s | s -> n where ... Source #

Equations

Half 'Ze = 'Ze 
Half ('Su ('Su z)) = 'Su (Half z) 

type family SPlus (n :: SNat) (n' :: SNat) where ... Source #

Equations

SPlus 'Ze 'Ze = 'Ze 
SPlus 'Ze a = a 
SPlus ('Su x) a = 'Su (SPlus x a) 
SPlus a ('SNegate b) = SMinus a b 
SPlus ('SNegate a) b = SMinus b a 

type family SMinus (n :: SNat) (n' :: SNat) where ... Source #

Equations

SMinus 'Ze 'Ze = 'Ze 
SMinus d 'Ze = d 
SMinus 'Ze d = 'SNegate d 
SMinus ('Su d) ('Su d') = SMinus d d' 
SMinus a ('SNegate b) = SPlus a b 
SMinus ('SNegate a) b = 'SNegate (SPlus a b) 

class SingInteger n where Source #

Methods

singToInteger :: n -> Integer Source #

Instances

Instances details
(SingInteger (Sing n), SingPrime p) => SingInteger (PrimePowerSing ('PrimePower p n)) Source # 
Instance details

Defined in Math.Number.TypeRational

SingPrime n => SingInteger (PrimeSing n) Source # 
Instance details

Defined in Math.Number.TypeRational

SingInteger (Sing x) => SingInteger (Sing ('Su x)) Source # 
Instance details

Defined in Math.Number.TypeRational

Methods

singToInteger :: Sing ('Su x) -> Integer Source #

SingInteger (Sing 'Ze) Source # 
Instance details

Defined in Math.Number.TypeRational

class SingRational r where Source #

class SingPrime (n :: Prime) where Source #

Instances

Instances details
SingPrime 'PrTwo Source # 
Instance details

Defined in Math.Number.TypeRational

SingPrime p => SingPrime ('NextPrimeAfter p) Source # 
Instance details

Defined in Math.Number.TypeRational

data PrimeSing :: Prime -> * where Source #

Instances

Instances details
SingPrime n => SingInteger (PrimeSing n) Source # 
Instance details

Defined in Math.Number.TypeRational

data PrimePowerSing :: PrimePower -> * where Source #

Constructors

SPrimePower :: PrimeSing p -> Sing n -> PrimePowerSing ('PrimePower p n) 

Instances

Instances details
(SingInteger (Sing n), SingPrime p) => SingInteger (PrimePowerSing ('PrimePower p n)) Source # 
Instance details

Defined in Math.Number.TypeRational

data RatSing :: SRat -> * where Source #

Constructors

SRatOne :: RatSing 'PrOne 
SRatTimes :: PrimePowerSing p -> RatSing r -> RatSing ('PrTimes p r) 

data SRat Source #

Constructors

PrOne 
PrTimes PrimePower SRat 

data Prime Source #

Constructors

PrTwo 
NextPrimeAfter Prime 

type family InvertPrime (a :: SRat) = (c :: SRat) | c -> a where ... Source #

type family ShiftPrime (a :: SRat) = (c :: SRat) | c -> a where ... Source #

type family RatMul (a :: SRat) (b :: SRat) :: SRat where ... Source #

type family RatDiv (a :: SRat) (b :: SRat) :: SRat where ... Source #

type SOne = 'Su 'Ze Source #

type STwo = 'Su SOne Source #

type POne = 'PrOne Source #