------------------------------------------------------------------------
-- The Agda standard library
--
-- Reflection utilities for ℕ
------------------------------------------------------------------------

{-# OPTIONS --without-K --safe #-}

module Data.Nat.Reflection where

open import Data.Nat.Base as 
open import Data.Fin.Base as Fin
open import Data.List.Base using ([])
open import Reflection.Term
open import Reflection.Argument

------------------------------------------------------------------------
-- Term

toTerm :   Term
toTerm zero    = con (quote ℕ.zero) []
toTerm (suc i) = con (quote ℕ.suc)  (toTerm i ⟨∷⟩ [])

toFinTerm :   Term
toFinTerm zero    = con (quote Fin.zero) (1 ⋯⟅∷⟆ [])
toFinTerm (suc i) = con (quote Fin.suc)  (1 ⋯⟅∷⟆ toFinTerm i ⟨∷⟩ [])