From 8eddb5e439005a1abf73703d58bb1c7749ca5807 Mon Sep 17 00:00:00 2001 From: Greg Brown Date: Sat, 17 Dec 2022 10:56:43 +0000 Subject: Add pretty printing. --- src/Obs/Sort.idr | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/Obs') diff --git a/src/Obs/Sort.idr b/src/Obs/Sort.idr index 16eaa96..281a053 100644 --- a/src/Obs/Sort.idr +++ b/src/Obs/Sort.idr @@ -1,5 +1,7 @@ module Obs.Sort +import Text.PrettyPrint.Prettyprinter + -- Definition ------------------------------------------------------------------ public export @@ -23,6 +25,12 @@ Show Sort where show (Set 0) = "Set" show (Set (S i)) = "Set \{show (S i)}" +export +Pretty Sort where + prettyPrec d Prop = pretty "Prop" + prettyPrec d (Set 0) = pretty "Set" + prettyPrec d (Set (S i)) = parenthesise (d >= App) $ pretty "Set \{show (S i)}" + -- Operations ------------------------------------------------------------------ infix 5 ~> -- cgit v1.2.3