DivMod.agda 457 B

123456789101112131415161718192021222324
  1. {-# OPTIONS --guardedness #-}
  2. module DivMod where
  3. open import IO
  4. open import Data.Nat
  5. open import Data.Nat.DivMod
  6. open import Codata.Musical.Notation
  7. open import Data.String.Base
  8. open import Data.Fin.Base using (toℕ)
  9. open import Level using (0ℓ)
  10. g : ℕ
  11. g = 7 div 5
  12. k : ℕ
  13. k = toℕ (7 mod 5)
  14. showNat : ℕ → String
  15. showNat zero = "Z"
  16. showNat (suc x) = "S (" ++ showNat x ++ ")"
  17. main = run {0ℓ} (putStrLn (showNat g) >> putStrLn (showNat k))