ContentsIndex
Org.Org.Semantic.HBase.TypeCalc.NaturalType
Synopsis
data Zero
data Succ n
class NaturalType a where
getNaturalTypeValue :: Type a -> Integer
class WholeType a
type One = Succ Zero
type Two = Succ One
type Three = Succ Two
type Four = Succ Three
type Five = Succ Four
type Six = Succ Five
type Seven = Succ Six
type Eight = Succ Seven
type Nine = Succ Eight
type Ten = Succ Nine
tZero :: Type Zero
tOne :: Type One
tTwo :: Type Two
tThree :: Type Three
tFour :: Type Four
tFive :: Type Five
tSix :: Type Six
tSeven :: Type Seven
tEight :: Type Eight
tNine :: Type Nine
tTen :: Type Ten
class AddOne a b | a -> b, b -> a
class IsAtLeast a b c | a b -> c
class AtLeast a b
class AtLeastOne a
class Add a b ab | a b -> ab, ab a -> b
class Multiply a b ab | a b -> ab
class IsEven a e | a -> e
class Divide ab a b | ab a -> b, a b -> ab
Documentation
data Zero
Instances
IntegerType Zero
Negate Zero Zero
Negate Zero Zero
AddOne (NegativeSucc Zero) Zero
AddOne (NegativeSucc Zero) Zero
IsAtLeast Zero (NegativeSucc b) True
IsAtLeast (NegativeSucc a) Zero False
AddOne bm1 b => Add (NegativeSucc Zero) b bm1
Absolute Zero Zero Zero
Absolute Zero Zero Zero
Absolute Zero Zero Zero
GCD Zero b b
GCD (Succ a) Zero (Succ a)
Nth Zero (a, list) a list
NaturalType Zero
AddOne Zero (Succ Zero)
AddOne Zero (Succ Zero)
IsAtLeast Zero Zero True
IsAtLeast Zero Zero True
IsAtLeast Zero (Succ b) False
IsAtLeast (Succ a) Zero True
Add Zero b b
Multiply Zero b Zero
Multiply Zero b Zero
IsEven Zero True
Divide Zero (Succ a) Zero
Divide Zero (Succ a) Zero
Divide (Succ b) (Succ Zero) (Succ b)
data Succ n
Instances
NaturalType a => IntegerType (Succ a)
Negate (Succ a) (NegativeSucc a)
Negate (NegativeSucc a) (Succ a)
AddOne (NegativeSucc (Succ a)) (NegativeSucc a)
IsAtLeast (Succ a) (NegativeSucc b) True
IsAtLeast (NegativeSucc a) (Succ b) False
(Add (NegativeSucc a) b ab, AddOne abm1 ab) => Add (NegativeSucc (Succ a)) b abm1
Absolute (Succ a) (Succ a) One
Absolute (Succ a) (Succ a) One
Absolute (NegativeSucc a) (Succ a) MinusOne
Divide (Succ a) (Succ b) (Succ c) => Divide (NegativeSucc a) (Succ b) (NegativeSucc c)
GCD (Succ a) Zero (Succ a)
GCD (Succ a) Zero (Succ a)
(Add b amb a, Absolute amb diff sign, IsAtLeast Zero amb abigger, Pick abigger b a smaller, GCD (Succ smaller) diff gcd) => GCD (Succ a) (Succ b) gcd
(Add b amb a, Absolute amb diff sign, IsAtLeast Zero amb abigger, Pick abigger b a smaller, GCD (Succ smaller) diff gcd) => GCD (Succ a) (Succ b) gcd
Nth n list elem rest => Nth (Succ n) (a, list) elem (a, rest)
NaturalType a => NaturalType (Succ a)
NaturalType a => WholeType (Succ a)
AddOne Zero (Succ Zero)
AddOne (Succ a) (Succ (Succ a))
AddOne (Succ a) (Succ (Succ a))
AddOne (Succ a) (Succ (Succ a))
IsAtLeast Zero (Succ b) False
IsAtLeast (Succ a) Zero True
IsAtLeast a b c => IsAtLeast (Succ a) (Succ b) c
IsAtLeast a b c => IsAtLeast (Succ a) (Succ b) c
(Add a b ab, AddOne ab ab1) => Add (Succ a) b ab1
(Multiply a b ab, Add ab b abb) => Multiply (Succ a) b abb
(IsEven a e, Not e ne) => IsEven (Succ a) ne
Divide Zero (Succ a) Zero
Divide (Succ b) (Succ Zero) (Succ b)
Divide (Succ b) (Succ Zero) (Succ b)
Divide (Succ b) (Succ Zero) (Succ b)
(Add b amb a, Divide amb (Succ (Succ b)) c) => Divide (Succ a) (Succ (Succ b)) (Succ c)
(Add b amb a, Divide amb (Succ (Succ b)) c) => Divide (Succ a) (Succ (Succ b)) (Succ c)
(Add b amb a, Divide amb (Succ (Succ b)) c) => Divide (Succ a) (Succ (Succ b)) (Succ c)
(Add b amb a, Divide amb (Succ (Succ b)) c) => Divide (Succ a) (Succ (Succ b)) (Succ c)
class NaturalType a where
Metatype
Methods
getNaturalTypeValue :: Type a -> Integer
Instances
NaturalType Zero
NaturalType a => NaturalType (Succ a)
class WholeType a
Instances
NaturalType a => WholeType (Succ a)
type One = Succ Zero
type Two = Succ One
type Three = Succ Two
type Four = Succ Three
type Five = Succ Four
type Six = Succ Five
type Seven = Succ Six
type Eight = Succ Seven
type Nine = Succ Eight
type Ten = Succ Nine
tZero :: Type Zero
tOne :: Type One
tTwo :: Type Two
tThree :: Type Three
tFour :: Type Four
tFive :: Type Five
tSix :: Type Six
tSeven :: Type Seven
tEight :: Type Eight
tNine :: Type Nine
tTen :: Type Ten
class AddOne a b | a -> b, b -> a
Instances
AddOne (NegativeSucc (Succ a)) (NegativeSucc a)
AddOne (NegativeSucc Zero) Zero
AddOne Zero (Succ Zero)
AddOne (Succ a) (Succ (Succ a))
class IsAtLeast a b c | a b -> c
Instances
IsAtLeast Zero (NegativeSucc b) True
IsAtLeast (Succ a) (NegativeSucc b) True
IsAtLeast (NegativeSucc a) Zero False
IsAtLeast (NegativeSucc a) (Succ b) False
IsAtLeast b a c => IsAtLeast (NegativeSucc a) (NegativeSucc b) c
IsAtLeast Zero Zero True
IsAtLeast Zero (Succ b) False
IsAtLeast (Succ a) Zero True
IsAtLeast a b c => IsAtLeast (Succ a) (Succ b) c
class AtLeast a b
Instances
IsAtLeast a b True => AtLeast a b
class AtLeastOne a
Instances
WholeType a => AtLeastOne a
class Add a b ab | a b -> ab, ab a -> b
Instances
(Add (NegativeSucc a) b ab, AddOne abm1 ab) => Add (NegativeSucc (Succ a)) b abm1
AddOne bm1 b => Add (NegativeSucc Zero) b bm1
Add Zero b b
(Add a b ab, AddOne ab ab1) => Add (Succ a) b ab1
class Multiply a b ab | a b -> ab
Instances
(Multiply (Succ a) b ab, Negate ab nab) => Multiply (NegativeSucc a) b nab
Multiply Zero b Zero
(Multiply a b ab, Add ab b abb) => Multiply (Succ a) b abb
class IsEven a e | a -> e
Instances
(IsEven a e, Not e ne) => IsEven (NegativeSucc a) ne
IsEven Zero True
(IsEven a e, Not e ne) => IsEven (Succ a) ne
class Divide ab a b | ab a -> b, a b -> ab
Instances
(Divide a (Succ b) c, Negate c nc) => Divide a (NegativeSucc b) nc
Divide (Succ a) (Succ b) (Succ c) => Divide (NegativeSucc a) (Succ b) (NegativeSucc c)
Divide Zero (Succ a) Zero
Divide (Succ b) (Succ Zero) (Succ b)
(Add b amb a, Divide amb (Succ (Succ b)) c) => Divide (Succ a) (Succ (Succ b)) (Succ c)
Produced by Haddock version 0.6