Skip to content

Commit d6c683c

Browse files
hargoniXkim-em
authored andcommitted
fix: regression from ST redefinition (#10940)
This PR fixes a regression introduced by the `ST` redefinition by making the definition of `ST` as reducible as previously. The key issue here is that in the previous state it would reduce to a function at which point the monad lifting mechanisms don't kick in in the same fashion anymore.
1 parent fd2fe11 commit d6c683c

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/Init/System/ST.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ A restricted version of `IO` in which mutable state is the only side effect.
3131
3232
It is possible to run `ST` computations in a non-monadic context using `runST`.
3333
-/
34-
abbrev ST (σ : Type) (α : Type) := Void σ → ST.Out σ α
34+
@[expose] def ST (σ : Type) (α : Type) := Void σ → ST.Out σ α
3535

3636
namespace ST
3737

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import Lean.Meta.Basic
2+
3+
open Lean
4+
5+
instance [Monad m] [MonadLiftT MetaM m] : MonadLiftT (ST IO.RealWorld) m where
6+
monadLift x := (x : MetaM _)

0 commit comments

Comments
 (0)