Show for contexts, etc

This commit is contained in:
rhiannon morris 2023-09-17 19:09:54 +02:00
parent ac518472ad
commit e1257560b7
3 changed files with 11 additions and 5 deletions

View file

@ -4,8 +4,10 @@ import Quox.Syntax
import Quox.Context import Quox.Context
import Quox.Pretty import Quox.Pretty
import public Data.Singleton import public Data.Singleton
import Derive.Prelude
%default total %default total
%language ElabReflection
public export public export
@ -36,6 +38,7 @@ record TyContext d n where
tnames : BContext n -- only used for printing tnames : BContext n -- only used for printing
qtys : QContext n -- only used for printing qtys : QContext n -- only used for printing
%name TyContext ctx %name TyContext ctx
%runElab deriveIndexed "TyContext" [Show]
public export public export
@ -49,6 +52,7 @@ record EqContext n where
tnames : BContext n -- only used for printing tnames : BContext n -- only used for printing
qtys : QContext n -- only used for printing qtys : QContext n -- only used for printing
%name EqContext ctx %name EqContext ctx
%runElab deriveIndexed "EqContext" [Show]
public export public export
@ -58,6 +62,7 @@ record WhnfContext d n where
tnames : BContext n tnames : BContext n
tctx : TContext d n tctx : TContext d n
%name WhnfContext ctx %name WhnfContext ctx
%runElab deriveIndexed "WhnfContext" [Show]
namespace TContext namespace TContext
export %inline export %inline

View file

@ -8,6 +8,10 @@ import Quox.Pretty
import Data.List import Data.List
import Control.Eff import Control.Eff
import Derive.Prelude
%language ElabReflection
%hide TT.Name
public export public export
@ -15,6 +19,7 @@ record NameContexts d n where
constructor MkNameContexts constructor MkNameContexts
dnames : BContext d dnames : BContext d
tnames : BContext n tnames : BContext n
%runElab deriveIndexed "NameContexts" [Show]
namespace NameContexts namespace NameContexts
export export
@ -105,6 +110,7 @@ data Error
(Elim 0 n) (Elim 0 n) (Elim 0 n) (Elim 0 n)
Error Error
%name Error err %name Error err
%runElab derive "Error" [Show]
public export public export
ErrorEff : Type -> Type ErrorEff : Type -> Type

View file

@ -12,11 +12,6 @@ import Derive.Prelude
%language ElabReflection %language ElabReflection
%runElab deriveIndexed "TyContext" [Show]
%runElab deriveIndexed "EqContext" [Show]
%runElab deriveIndexed "NameContexts" [Show]
%runElab derive "Error" [Show]
export export
ToInfo Error where ToInfo Error where
toInfo err = toInfo err =