symantic-6.3.0.20170807: Library for Typed Tagless-Final Higher-Order Composable DSL
Language.Symantic.Typing.Peano
Contents
Zero
Succ
SPeano
IPeano
EPeano
Integral
Description
Natural numbers inductivey defined at the type-level, and of kind *.
*
Synopsis
data Zero Source #
Instances
Methods
ipeano :: SPeano Zero Source #
symInjP :: TeSym ((* ': Proxy Zero s) [*]) ts t -> TeSym ss ts t Source #
data Succ p Source #
symInjP :: TeSym ((* ': Proxy (Succ p) s) [*]) ts t -> TeSym ss ts t Source #
ipeano :: SPeano (Succ p) Source #
type P0 = Zero Source #
type P1 = Succ P0 Source #
type P2 = Succ P1 Source #
type P3 = Succ P2 Source #
data SPeano p where Source #
Singleton for Zero and Succ.
Constructors
testEquality :: f a -> f b -> Maybe ((SPeano :~: a) b) #
class IPeano p where Source #
Implicit construction of SPeano.
Minimal complete definition
ipeano
ipeano :: SPeano p Source #
data EPeano where Source #
(==) :: EPeano -> EPeano -> Bool #
(/=) :: EPeano -> EPeano -> Bool #
showsPrec :: Int -> EPeano -> ShowS #
show :: EPeano -> String #
showList :: [EPeano] -> ShowS #
integral_from_peano :: Integral i => SPeano p -> i Source #
peano_from_integral :: Integral i => i -> (forall p. SPeano p -> ret) -> ret Source #