Source code on Github
{-# OPTIONS --cubical-compatible #-}
module Class.FromN where

open import Class.Prelude

record Fromℕ (A : Type ) : Type  where
  field fromℕ :   A
open Fromℕ ⦃...⦄ public

instance
  Fromℕ-ℕ    = Fromℕ   λ where .fromℕ  id
  Fromℕ-Int  = Fromℕ   λ where .fromℕ  Int.+_
  Fromℕ-ℕᵇ   = Fromℕ ℕᵇ  λ where .fromℕ  Bin.fromℕ
  Fromℕ-Char = Fromℕ Char  λ where .fromℕ  Ch.fromℕ
  Fromℕ-Word = Fromℕ Word64  λ where .fromℕ  Word.fromℕ
  Fromℕ-Fin  = Fromℕ ( Fin)  λ where .fromℕ  -,_  Fi.fromℕ