Debian Codegraph @

tests/text/printf/Main.agda

raw
1 {-# OPTIONS --guardedness #-}
2
3 module Main where
4
5 open import Data.Integer.Base as ℤ using (+_)
6 open import Data.Integer.Literals
7 open import Data.Integer.GCD
8 open import Data.Integer.LCM
9 open import Data.Nat.Base
10 open import Data.String.Base
11 open import Data.Unit.Base
12 open import Function.Base using (_$_)
13 open import IO.Base
14 open import IO.Finite
15
16 open import Text.Printf
17
18 main : Main
19 main = run $ do
20 let instance _ = negative
21 putStrLn $ printf "%s: %u + %u ≡ %u" "example" 3 2 5
22 putStrLn $ printf "%s: %u + %i ≡ %d" "example" 3 -3 (+ 3 ℤ.+ -3)
23 putStrLn $ printf "gcd(%d,%i) ≡ %d" -9 (+ 15) (gcd -9 (+ 15))
24 putStrLn $ printf "lcm(%d,%i) ≡ %d" -9 (+ 15) (lcm -9 (+ 15))
25 putStrLn $ printf "A %s: %c" "char" 'c'
26 putStrLn $ printf "A %s: %f" "float" 3.14