quox/tests/TypingImpls.idr

37 lines
799 B
Idris

module TypingImpls
import TAP
import public Quox.Typing
import public Quox.Pretty
import public TermImpls
import Derive.Prelude
%language ElabReflection
%runElab derive "Reduce.WhnfError" [Show]
%runElab deriveIndexed "DimEq" [Show]
export %hint
showTyContext : (PrettyHL q, Show q) => Show (TyContext q d n)
showTyContext = deriveShow
export %hint
showEqContext : (PrettyHL q, Show q) => Show (EqContext q n)
showEqContext = deriveShow
export %hint
showTypingError : (PrettyHL q, Show q) => Show (Error q)
showTypingError = deriveShow
export
ToInfo WhnfError where
toInfo (MissingEnumArm t ts) =
[("type", "MissingEnumArm"),
("tag", show t),
("list", show ts)]
export
(Eq q, PrettyHL q) => ToInfo (Error q) where
toInfo err = [("err", show $ prettyError True True err)]