symantic-6.3.2.20180208: Library for Typed Tagless-Final Higher-Order Composable DSL

Safe HaskellSafe
LanguageHaskell2010

Language.Symantic.Typing.Peano

Contents

Description

Natural numbers inductivey defined at the type-level, and of kind *.

Synopsis

Types Zero and Succ

data Zero Source #

Instances
IPeano Zero Source # 
Instance details

Defined in Language.Symantic.Typing.Peano

SymInjP Zero (Proxy s ': ss) (s :: k) Source # 
Instance details

Defined in Language.Symantic.Compiling.Term

Methods

symInjP :: TeSym (Proxy s ': []) ts t -> TeSym (Proxy s ': ss) ts t Source #

data Succ p Source #

Instances
IPeano p => IPeano (Succ p) Source # 
Instance details

Defined in Language.Symantic.Typing.Peano

Methods

ipeano :: SPeano (Succ p) Source #

SymInjP p ss s => SymInjP (Succ p :: *) (Proxy not_s ': ss) (s :: k2) Source # 
Instance details

Defined in Language.Symantic.Compiling.Term

Methods

symInjP :: TeSym (Proxy s ': []) ts t -> TeSym (Proxy not_s ': ss) ts t Source #

Type synonyms for a few numbers

type P0 = Zero Source #

type P1 = Succ P0 Source #

type P2 = Succ P1 Source #

type P3 = Succ P2 Source #

Type SPeano

data SPeano p where Source #

Singleton for Zero and Succ.

Constructors

SZero :: SPeano Zero 
SSucc :: SPeano p -> SPeano (Succ p) 
Instances
TestEquality SPeano Source # 
Instance details

Defined in Language.Symantic.Typing.Peano

Methods

testEquality :: SPeano a -> SPeano b -> Maybe (a :~: b) #

Type IPeano

class IPeano p where Source #

Implicit construction of SPeano.

Minimal complete definition

ipeano

Methods

ipeano :: SPeano p Source #

Instances
IPeano Zero Source # 
Instance details

Defined in Language.Symantic.Typing.Peano

IPeano p => IPeano (Succ p) Source # 
Instance details

Defined in Language.Symantic.Typing.Peano

Methods

ipeano :: SPeano (Succ p) Source #

Type EPeano

data EPeano where Source #

Constructors

EPeano :: SPeano p -> EPeano 
Instances
Eq EPeano Source # 
Instance details

Defined in Language.Symantic.Typing.Peano

Methods

(==) :: EPeano -> EPeano -> Bool #

(/=) :: EPeano -> EPeano -> Bool #

Show EPeano Source # 
Instance details

Defined in Language.Symantic.Typing.Peano

Interface with Integral

peano_from_integral :: Integral i => i -> (forall p. SPeano p -> ret) -> ret Source #