Skip to content

Commit f047d95

Browse files
committed
chore: use String.ofList instead of String.mk in elaborator+kernel
1 parent 3d30792 commit f047d95

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

src/Lean/Meta/ExprDefEq.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,12 +155,12 @@ def isDefEqNat (s t : Expr) : MetaM LBool := do
155155
| none, some t => isDefEq s t
156156
| none, none => pure LBool.undef
157157

158-
/-- Support for constraints of the form `("..." =?= String.mk cs)` -/
158+
/-- Support for constraints of the form `("..." =?= String.ofList cs)` -/
159159
def isDefEqStringLit (s t : Expr) : MetaM LBool := do
160160
let isDefEq (s t) : MetaM LBool := toLBoolM <| Meta.isExprDefEqAux s t
161-
if s.isStringLit && t.isAppOf ``String.mk then
161+
if s.isStringLit && t.isAppOf ``String.ofList then
162162
isDefEq (← s.toCtorIfLit) t
163-
else if s.isAppOf ``String.mk && t.isStringLit then
163+
else if s.isAppOf ``String.ofList && t.isStringLit then
164164
isDefEq s (← t.toCtorIfLit)
165165
else
166166
pure LBool.undef

src/Lean/Meta/WHNF.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def toCtorIfLit : Expr → MetaM Expr
2525
if v == 0 then return mkConst ``Nat.zero
2626
else return mkApp (mkConst ``Nat.succ) (mkRawNatLit (v-1))
2727
| .lit (.strVal v) =>
28-
Lean.Meta.whnf (mkApp (mkConst ``String.mk) (toExpr v.toList))
28+
Lean.Meta.whnf (mkApp (mkConst ``String.ofList) (toExpr v.toList))
2929
| e => return e
3030

3131
end Lean.Expr

src/kernel/inductive.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1223,7 +1223,7 @@ void initialize_inductive() {
12231223
mark_persistent(g_nat_zero->raw());
12241224
g_nat_succ = new expr(mk_constant(name{"Nat", "succ"}));
12251225
mark_persistent(g_nat_succ->raw());
1226-
g_string_mk = new expr(mk_constant(name{"String", "mk"}));
1226+
g_string_mk = new expr(mk_constant(name{"String", "ofList"}));
12271227
mark_persistent(g_string_mk->raw());
12281228
expr char_type = mk_constant(name{"Char"});
12291229
g_list_cons_char = new expr(mk_app(mk_constant(name{"List", "cons"}, {level()}), char_type));

src/kernel/type_checker.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1201,7 +1201,7 @@ void initialize_type_checker() {
12011201
g_nat_xor = new_persistent_expr_const({"Nat", "xor"});
12021202
g_nat_shiftLeft = new_persistent_expr_const({"Nat", "shiftLeft"});
12031203
g_nat_shiftRight = new_persistent_expr_const({"Nat", "shiftRight"});
1204-
g_string_mk = new_persistent_expr_const({"String", "mk"});
1204+
g_string_mk = new_persistent_expr_const({"String", "ofList"});
12051205
g_lean_reduce_bool = new_persistent_expr_const({"Lean", "reduceBool"});
12061206
g_lean_reduce_nat = new_persistent_expr_const({"Lean", "reduceNat"});
12071207
register_name_generator_prefix(*g_kernel_fresh);

0 commit comments

Comments
 (0)