Object/Trait

typequux

Nat

Related Docs: trait Nat | package typequux

Permalink

object Nat

Contains implementation traits for Nat and typeconstructor aliases that make usage more pleasant.

1. Additive commutativity: +[A, B] =:= +[B, A]

2. Additive associativity: +[A, +[B, C]] =:= +[+[A, B], C]

3. Additive identity: +[A, _0] =:= A =:= +[_0, A]

4. Multiplicative commutativity: *[A, B] =:= *[B, A]

5. Multiplicative associativity: *[A, *[B, C]] =:= *[*[A, B], C]

6. Multiplicative identity: *[A, _1] =:= A =:= *[_1, A]

7. Distributivity: *[A, +[B, C]] =:= +[*[A, B], *[A, C]]

8. Zero exponent: ^[A, _0] =:= _1

9. One exponent: ^[_1, A] =:= _1

10. Exponent Identity: ^[A, _1] =:= A

11. Total Order

Author:

Harshad Deo

Since

0.1

Linear Supertypes
Ordering
  1. Grouped
  2. Alphabetic
  3. By Inheritance
Inherited
  1. Nat
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. type *[A <: Nat, B <: Nat] = Nat.*.A.FoldR[_0, Nat, SumFold[B]]

    Permalink

    Alias for multiplying two numbers

    Alias for multiplying two numbers

    Author:

    Harshad Deo

    Since

    0.1

  2. type +[A <: Nat, B <: Nat] = Nat.+.A.FoldR[B, Nat, IncFold]

    Permalink

    Alias for adding two numbers

    Alias for adding two numbers

    Author:

    Harshad Deo

    Since

    0.1

  3. type <[A <: Nat, B <: Nat] = Nat.Compare.Match[True, False, False, Bool]

    Permalink

    Alias for checking if the first number is less than the second

    Alias for checking if the first number is less than the second

    Author:

    Harshad Deo

    Since

    0.1

  4. type <=[A <: Nat, B <: Nat] = Nat.Compare.Match[True, True, False, Bool]

    Permalink

    Alias for checking if the first number is less than or equal to the second

    Alias for checking if the first number is less than or equal to the second

    Author:

    Harshad Deo

    Since

    0.1

  5. type ===[A <: Nat, B <: Nat] = Nat.Compare.Match[False, True, False, Bool]

    Permalink

    Alias for checking if the two numbers are equal

    Alias for checking if the two numbers are equal

    Author:

    Harshad Deo

    Since

    0.1

  6. type >[A <: Nat, B <: Nat] = Nat.Compare.Match[False, False, True, Bool]

    Permalink

    Alias for checking if the first number is greater than the second

    Alias for checking if the first number is greater than the second

    Author:

    Harshad Deo

    Since

    0.1

  7. type >=[A <: Nat, B <: Nat] = Nat.Compare.Match[False, True, True, Bool]

    Permalink

    Alias for checking if the first number is greater than or equal to the second

    Alias for checking if the first number is greater than or equal to the second

    Author:

    Harshad Deo

    Since

    0.1

  8. type Compare[A <: Nat, B <: Nat] = Nat.Compare.A.Compare[B]

    Permalink

    Alias for getting the result of comparing two numbers

    Alias for getting the result of comparing two numbers

    Author:

    Harshad Deo

    Since

    0.1

  9. trait ExpFold[By <: Nat] extends Fold[Nat, Nat]

    Permalink

    Fold to compute the exponent

    Fold to compute the exponent

    Author:

    Harshad Deo

    Since

    0.1

  10. type Fact[A <: Nat] = Nat.Fact.A.FoldL[_1, Nat, ProdFold]

    Permalink

    Alias for computing the factorial of the number

    Alias for computing the factorial of the number

    Author:

    Harshad Deo

    Since

    0.1

  11. trait IncFold extends Fold[Any, Nat]

    Permalink

    Fold to compute the increment of a number

    Fold to compute the increment of a number

    Author:

    Harshad Deo

    Since

    0.1

  12. type IsO[A <: Nat] = Nat.IsO.A.Match[ConstFalse, True, Bool]

    Permalink

    Alias for checking if the number is zero

    Alias for checking if the number is zero

    Author:

    Harshad Deo

    Since

    0.1

  13. final class Nat0 extends Nat

    Permalink

    Represents zero in peano encoding of natural numbers

    Represents zero in peano encoding of natural numbers

    Author:

    Harshad Deo

    Since

    0.1

  14. final class NatRep[N <: Nat] extends AnyVal

    Permalink

    Builds a value level representation of the Nat

    Builds a value level representation of the Nat

    Author:

    Harshad Deo

    N

    Natural number for which the value level representation is being built

    Since

    0.1

  15. trait ProdFold extends Fold[Nat, Nat]

    Permalink

    Fold to compute the product

    Fold to compute the product

    Author:

    Harshad Deo

    Since

    0.1

  16. type Sq[A <: Nat] = Nat.Sq.A.FoldR[_0, Nat, SumFold[FoldR[_1, Nat, ExpFold[A]]]]

    Permalink

    Alias for computing the square of the number

    Alias for computing the square of the number

    Author:

    Harshad Deo

    Since

    0.1

  17. final class Succ[N <: Nat] extends Nat

    Permalink

    Represents a successor in the peano encoding of natural numbers

    Represents a successor in the peano encoding of natural numbers

    Author:

    Harshad Deo

    N

    Peano-type to which this is a successor

    Since

    0.1

  18. trait SumFold[By <: Nat] extends Fold[Nat, Nat]

    Permalink

    Fold to compute the sum

    Fold to compute the sum

    Author:

    Harshad Deo

    Since

    0.1

  19. type ^[A <: Nat, B <: Nat] = Nat.^.B.FoldR[_1, Nat, ExpFold[A]]

    Permalink

    Alias for computing the exponent of the number

    Alias for computing the exponent of the number

    Author:

    Harshad Deo

    Since

    0.1

  20. type _0 = Nat0

    Permalink

    Peano 0

    Peano 0

    Author:

    Harshad Deo

    Since

    0.1

  21. type _1 = Succ[_0]

    Permalink

    Peano 1

    Peano 1

    Author:

    Harshad Deo

    Since

    0.1

  22. type _2 = Succ[_1]

    Permalink

    Peano 2

    Peano 2

    Author:

    Harshad Deo

    Since

    0.1

  23. type _3 = Succ[_2]

    Permalink

    Peano 3

    Peano 3

    Author:

    Harshad Deo

    Since

    0.1

  24. type _4 = Succ[_3]

    Permalink

    Peano 4

    Peano 4

    Author:

    Harshad Deo

    Since

    0.1

  25. type _5 = Succ[_4]

    Permalink

    Peano 5

    Peano 5

    Author:

    Harshad Deo

    Since

    0.1

  26. type _6 = Succ[_5]

    Permalink

    Peano 6

    Peano 6

    Author:

    Harshad Deo

    Since

    0.1

  27. type _7 = Succ[_6]

    Permalink

    Peano 7

    Peano 7

    Author:

    Harshad Deo

    Since

    0.1

  28. type _8 = Succ[_7]

    Permalink

    Peano 8

    Peano 8

    Author:

    Harshad Deo

    Since

    0.1

  29. type _9 = Succ[_8]

    Permalink

    Peano 9

    Peano 9

    Author:

    Harshad Deo

    Since

    0.1

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. object NatRep

    Permalink

    Provides implicit definitions to build a value level representation of a Nat

    Provides implicit definitions to build a value level representation of a Nat

    Author:

    Harshad Deo

    Since

    0.1

  5. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  6. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  7. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  8. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  9. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  10. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  11. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  12. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  13. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  14. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  15. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  16. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  17. def toInt[N <: Nat](implicit ev: NatRep[N]): Int

    Permalink

    Builds a value level representation of a Nat

    Builds a value level representation of a Nat

    Author:

    Harshad Deo

    N

    Nat for which the value level representation is to be built

    Since

    0.1

  18. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  19. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  20. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  21. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Implementation

Number aliases

Operations

Ungrouped