quox/lib/Quox/PrettyValExtra.idr

21 lines
512 B
Idris
Raw Normal View History

2023-10-19 22:53:20 -04:00
module Quox.PrettyValExtra
2024-04-12 15:49:15 -04:00
import Data.DPair
2023-10-19 22:53:20 -04:00
import Derive.Prelude
import public Text.Show.Value
import public Text.Show.PrettyVal
import public Text.Show.PrettyVal.Derive
%language ElabReflection
%runElab derive "SnocList" [PrettyVal]
2024-04-12 15:49:15 -04:00
export %inline
PrettyVal a => PrettyVal (Subset a p) where
prettyVal (Element x _) = Con "Element" [prettyVal x, Con "_" []]
export %inline
(forall x. PrettyVal (p x)) => PrettyVal (Exists p) where
prettyVal (Evidence _ p) = Con "Evidence" [Con "_" [], prettyVal p]