rename Equal.Env to CmpContext

This commit is contained in:
rhiannon morris 2023-02-19 17:02:13 +01:00
parent cba6dafc58
commit d71ac8c34d

View file

@ -9,23 +9,23 @@ import Data.Maybe
public export
record Env where
constructor MakeEnv
record CmpContext where
constructor MkCmpContext
mode : EqMode
public export
0 HasEnv : (Type -> Type) -> Type
HasEnv = MonadReader Env
0 HasCmpContext : (Type -> Type) -> Type
HasCmpContext = MonadReader CmpContext
public export
0 CanEqual : (q : Type) -> (Type -> Type) -> Type
CanEqual q m = (HasErr q m, HasEnv m)
CanEqual q m = (HasErr q m, HasCmpContext m)
private %inline
mode : HasEnv m => m EqMode
mode : HasCmpContext m => m EqMode
mode = asks mode
private %inline
@ -287,7 +287,7 @@ parameters {auto _ : (HasDefs' q _ m, HasErr q m, Eq q)} (ctx : TyContext q d n)
compare : (ty, s, t : Term q d n) -> m ()
compare ty s t = do
defs <- ask
runReaderT {m} (MakeEnv {mode}) $
runReaderT {m} (MkCmpContext {mode}) $
for_ (splits ctx.dctx) $ \th =>
compare0 defs (map (/// th) ctx.tctx)
(ty /// th) (s /// th) (t /// th)
@ -296,7 +296,7 @@ parameters {auto _ : (HasDefs' q _ m, HasErr q m, Eq q)} (ctx : TyContext q d n)
compareType : (s, t : Term q d n) -> m ()
compareType s t = do
defs <- ask
runReaderT {m} (MakeEnv {mode}) $
runReaderT {m} (MkCmpContext {mode}) $
for_ (splits ctx.dctx) $ \th =>
compareType defs (map (/// th) ctx.tctx) (s /// th) (t /// th)
@ -307,7 +307,7 @@ parameters {auto _ : (HasDefs' q _ m, HasErr q m, Eq q)} (ctx : TyContext q d n)
compare : (e, f : Elim q d n) -> m ()
compare e f = do
defs <- ask
runReaderT {m} (MakeEnv {mode}) $
runReaderT {m} (MkCmpContext {mode}) $
for_ (splits ctx.dctx) $ \th =>
compare0 defs (map (/// th) ctx.tctx) (e /// th) (f /// th)