From 66f5112c0f5a550b18349fa856c1c217713d4609 Mon Sep 17 00:00:00 2001 From: Oscar Eriksson Date: Tue, 14 Nov 2023 14:42:32 +0100 Subject: [PATCH] Add empty old empty environment alias to not break DSLs --- stdlib/mexpr/symbolize.mc | 9 +++++++-- stdlib/mexpr/type-check.mc | 5 +++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/stdlib/mexpr/symbolize.mc b/stdlib/mexpr/symbolize.mc index 982359762..b771cc9be 100644 --- a/stdlib/mexpr/symbolize.mc +++ b/stdlib/mexpr/symbolize.mc @@ -31,7 +31,7 @@ type SymEnv = { ignoreExternals: Bool } -let symEnvEmpty = { +let _symEnvEmpty = { varEnv = mapEmpty cmpString, conEnv = mapEmpty cmpString, tyVarEnv = mapEmpty cmpString, @@ -47,7 +47,12 @@ let symEnvAddBuiltinTypes : all a. SymEnv -> [(String, a)] -> SymEnv } let symEnvDefault = - symEnvAddBuiltinTypes symEnvEmpty builtinTypes + symEnvAddBuiltinTypes _symEnvEmpty builtinTypes + +-- TODO(oerikss, 2023-11-14): Change all DSLs that use this name for the +-- symbolize environment to instead point to `symEnvDefault` and then +-- remove this alias and rename `_symEnvEmpty` to `symEnvEmpty`. +let symEnvEmpty = symEnvDefault lang SymLookup type LookupParams = {kind : String, info : [Info], allowFree : Bool} diff --git a/stdlib/mexpr/type-check.mc b/stdlib/mexpr/type-check.mc index 6d0061b22..0f600b86d 100644 --- a/stdlib/mexpr/type-check.mc +++ b/stdlib/mexpr/type-check.mc @@ -60,6 +60,11 @@ let typecheckEnvAddBuiltinTypes : TCEnv -> [(String, [String])] -> TCEnv let typcheckEnvDefault = typecheckEnvAddBuiltinTypes typcheckEnvEmpty builtinTypes +-- TODO(oerikss, 2023-11-14): Change all DSLs that use this name for the +-- type-check environment to instead point to `typcheckEnvDefault` and then +-- remove this alias. +let _tcEnvEmpty = typcheckEnvDefault + let _insertVar = lam name. lam ty. lam env : TCEnv. {env with varEnv = mapInsert name ty env.varEnv}