Packages

abstract class Nat extends AnyRef

Natural numbers for indexing in HLists.

All type-level computations are done with Church Numerals. Value-level computations at run-time are done directly on the underlying Int values, similar to java.lang.Integer.

Source
Nat.scala
Linear Supertypes
AnyRef, Any
Known Subclasses
Type Hierarchy
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Nat
  2. AnyRef
  3. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new Nat()

Type Members

  1. abstract type *[_ <: Nat] <: Nat

    Multiply another Nat with this one.

  2. abstract type +[_ <: Nat] <: Nat

    Add another Nat to this one.

  3. type ++ = Succ[Self]

    Increment this Nat.

  4. abstract type Flip_^[_ <: Nat] <: Nat
  5. abstract type Fold[U, F[_ <: U] <: U, Z <: U] <: U

    The type of a folding operation on this Nat.

  6. abstract type Self <: Nat

    The type of this Nat object.

  7. type ^[T <: Nat] = ^.T.Flip_^[Self]

    Raise this Nat to the exponent given by another Nat.

  8. type _0 = Self.*[_10]

    Multiply this Nat by 10.

  9. type _1 = *.+[Nat._1]

    Multiply this Nat by 10, then add 1.

  10. type _2 = *.+[Nat._2]

    Multiply this Nat by 10, then add 2.

  11. type _3 = *.+[Nat._3]

    Multiply this Nat by 10, then add 3.

  12. type _4 = *.+[Nat._4]

    Multiply this Nat by 10, then add 4.

  13. type _5 = *.+[Nat._5]

    Multiply this Nat by 10, then add 5.

  14. type _6 = *.+[Nat._6]

    Multiply this Nat by 10, then add 6.

  15. type _7 = *.+[Nat._7]

    Multiply this Nat by 10, then add 7.

  16. type _8 = *.+[Nat._8]

    Multiply this Nat by 10, then add 8.

  17. type _9 = *.+[Nat._9]

    Multiply this Nat by 10, then add 9.

Abstract Value Members

  1. abstract def self: Self

    This Nat, typed as Self.

  2. abstract def value: Int

    The equivalent Int value for this Nat.

Concrete Value Members

  1. def *[T <: Nat](n: T): *[T]

    Multiply another Nat with this one.

  2. def +[T <: Nat](n: T): +[T]

    Add another Nat to this one.

  3. def ++: ++

    Increment this Nat.

  4. def ^[T <: Nat](n: T): ^[T]

    Raise this Nat to the exponent given by another Nat.

  5. def _0: _0

    Multiply this Nat by 10.

  6. def _1: _1

    Multiply this Nat by 10, then add 1.

  7. def _2: _2

    Multiply this Nat by 10, then add 2.

  8. def _3: _3

    Multiply this Nat by 10, then add 3.

  9. def _4: _4

    Multiply this Nat by 10, then add 4.

  10. def _5: _5

    Multiply this Nat by 10, then add 5.

  11. def _6: _6

    Multiply this Nat by 10, then add 6.

  12. def _7: _7

    Multiply this Nat by 10, then add 7.

  13. def _8: _8

    Multiply this Nat by 10, then add 8.

  14. def _9: _9

    Multiply this Nat by 10, then add 9.

  15. def equals(o: Any): Boolean
    Definition Classes
    Nat → AnyRef → Any
  16. def hashCode(): Int
    Definition Classes
    Nat → AnyRef → Any
  17. def toString(): String
    Definition Classes
    Nat → AnyRef → Any