Skip to content

Commit

Permalink
Add empty old empty environment alias to not break DSLs
Browse files Browse the repository at this point in the history
  • Loading branch information
br4sco committed Nov 14, 2023
1 parent a8ab3dc commit 66f5112
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
9 changes: 7 additions & 2 deletions stdlib/mexpr/symbolize.mc
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ type SymEnv = {
ignoreExternals: Bool
}

let symEnvEmpty = {
let _symEnvEmpty = {
varEnv = mapEmpty cmpString,
conEnv = mapEmpty cmpString,
tyVarEnv = mapEmpty cmpString,
Expand All @@ -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}
Expand Down
5 changes: 5 additions & 0 deletions stdlib/mexpr/type-check.mc
Original file line number Diff line number Diff line change
Expand Up @@ -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}

Expand Down

0 comments on commit 66f5112

Please sign in to comment.