← Back

Modules

Leios

  • Abstract
  • Base
  • Blocks
  • Config
  • Defaults
  • FFD
  • Foreign.BaseTypes
  • Foreign.HsTypes
  • Foreign.Types
  • Foreign.Util
  • KeyRegistration
  • Network
  • Prelude
  • Protocol
  • Short
  • Short.Decidable
  • Short.Trace.Verifier
  • Short.Trace.Verifier.Test
  • Simplified
  • Simplified.Deterministic
  • SpecStructure
  • Traces
  • Voting
  • VRF
123456789101112131415161718192021222324
------------------------------------------------------------------------
-- The Agda standard library
--
-- Showing integers
------------------------------------------------------------------------
 
{-# OPTIONS --cubical-compatible --safe #-}
 
module Data.Integer.Show where
 
open import Data.Integer.Base using (ℤ; +_; -[1+_])
open import Data.Nat.Base using (suc)
open import Data.Nat.Show using () renaming (show to showℕ)
open import Data.String.Base using (String; _++_)
 
------------------------------------------------------------------------
-- Show
 
-- Decimal notation
-- Time complexity is O(log₁₀(n))
 
show : ℤ → String
show (+ n) = showℕ n
show -[1+ n ] = "-" ++ showℕ (suc n)