Source code on Github
{-# OPTIONS --safe #-}
module Prelude.ToN where

open import Prelude.Init; open SetAsType

record Toℕ (A : Type ) : Type  where
  field toℕ : A  
open Toℕ ⦃...⦄ public

instance
  Toℕ-ℕ    = Toℕ        λ where .toℕ  id
  Toℕ-Char = Toℕ Char    λ where .toℕ  Ch.toℕ
  Toℕ-Word = Toℕ Word64  λ where .toℕ  Word.toℕ
  Toℕ-Meta = Toℕ Meta    λ where .toℕ  Meta.Meta.toℕ
    where open Meta
  Toℕ-Fin :  {n}  Toℕ (Fin n)
  Toℕ-Fin .toℕ = F.toℕ