Debian Codegraph @

src/Data/Rational/Show.agda

raw
1 ------------------------------------------------------------------------
2 -- The Agda standard library
3 --
4 -- Showing rational numbers
5 ------------------------------------------------------------------------
6
7 {-# OPTIONS --cubical-compatible --safe #-}
8
9 module Data.Rational.Show where
10
11 import Data.Integer.Show as ℤ using (show)
12 open import Data.Rational.Base using (ℚ; ↥_; ↧_)
13 open import Data.String.Base using (String; _++_)
14
15 show : ℚ → String
16 show p = ℤ.show (↥ p) ++ "/" ++ ℤ.show (↧ p)