Derivatives for Containers in Univalent Foundations
Cubical.Data.Nat.Literals
Initializing search
    phijor/derivatives
    • Overview
    • Library
    phijor/derivatives
    • Overview
      • Derivative.Bag
      • Derivative.Adjunction
      • Derivative.Basics.Sum
      • Derivative.Basics.Unit
      • Derivative.Basics.W
      • Derivative.Basics.Decidable
      • Derivative.Basics.Embedding
      • Derivative.Basics.Equiv
      • Derivative.Basics.Maybe
      • Derivative.Basics.Sigma
      • Derivative.Category
      • Derivative.ChainRule
      • Derivative.Container
      • Derivative.Derivative
      • Derivative.Indexed.Mu
      • Derivative.Indexed.ChainRule
      • Derivative.Indexed.Container
      • Derivative.Indexed.Derivative
      • Derivative.Indexed.MuRule
      • Derivative.Indexed.Univalence
      • Derivative.Isolated.Base
      • Derivative.Isolated
      • Derivative.Isolated.S1
      • Derivative.Isolated.Sum
      • Derivative.Isolated.W
      • Derivative.Isolated.DependentGrafting
      • Derivative.Isolated.Grafting
      • Derivative.Isolated.Maybe
      • Derivative.Isolated.Sigma
      • Derivative.Prelude
      • Derivative.Properties
      • Derivative.Remove

    Cubical.Data.Nat.Literals

    {-
    
      Importing and re-exporting this module allows for (constrained) natural number
       and negative integer literals for any type (e.g. Int, ℕ₋₁, ℕ₋₂, ℕ₊₁).
    
    -}
    {-# OPTIONS --no-exact-split #-}
    module Cubical.Data.Nat.Literals where
    
    open import Agda.Builtin.FromNat public
      renaming (Number to HasFromNat)
    open import Agda.Builtin.FromNeg public
      renaming (Negative to HasFromNeg)
    open import Cubical.Data.Unit.Base public
    
    -- Natural number literals for ℕ
    
    open import Agda.Builtin.Nat renaming (Nat to ℕ)
    
    instance
      fromNatℕ : HasFromNat ℕ
      fromNatℕ = record { Constraint = λ _ → Unit ; fromNat = λ n → n }
    
    Made with Material for MkDocs