Documentation

ArkLib.Data.Classes.ToNat

ToNat Type Class #

This file defines the ToNat type class for converting values to natural numbers. This provides a uniform interface for extracting natural number representations from various types in the CNat hierarchy.

class ToNat (α : Type u) :

Type class for converting values to natural numbers.

  • toNat : α

    Convert a value to a natural number.

Instances
    Equations
    class LawfulToNat (α : Type u) [ToNat α] [Zero α] [HasSucc α] :

    A ToNat instance on a type α having zero and successor is lawful if toNat maps zero to zero and commutes with successor.

    Instances