------------------------------------------------------------------------
-- The Agda standard library
--
-- Conversion from naturals to universe levels
------------------------------------------------------------------------

{-# OPTIONS --cubical-compatible --safe #-}

module Level.Literals where

open import Agda.Builtin.Nat renaming (Nat to )
open import Agda.Builtin.FromNat
open import Agda.Builtin.Unit
open import Level using (Level; 0ℓ)

-- Increase a Level by a number of sucs.

infixl 6 _ℕ+_

_ℕ+_ :   Level  Level
zero  ℕ+  = 
suc n ℕ+  = Level.suc (n ℕ+ )

-- Nat-computed Level.

infix 10 #_

#_ :   Level
#_ = _ℕ+ 0ℓ

-- Literal overloading for levels.

Levelℕ : Number Level
Levelℕ .Number.Constraint _ = 
Levelℕ .Number.fromNat    n = # n