-
Notifications
You must be signed in to change notification settings - Fork 447
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: make
Lean.Internal.liftCoeM
and Lean.Internal.coeM
unfold
The elaboration function `Lean.Meta.coerceMonadLift?` inserts these coercion helper functions into a term and tries to unfolded them with `expandCoe`, but because that function only unfolds up to reducible-and-instance transparency, these functions were not being unfolded. The fix here is to give them the `@[reducible]` attribute.
- Loading branch information
Showing
3 changed files
with
25 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/- | ||
# Testing monad lift coercion elaborator | ||
The functions inserted for the coercions are supposed to be inlined immediately during elaboration. | ||
-/ | ||
|
||
variable (p : Nat → Prop) (m : IO (Subtype p)) | ||
|
||
/-! | ||
`Lean.Internal.liftCoeM` | ||
-/ | ||
#check (m : (ReaderT Int IO) Nat) | ||
|
||
/-! | ||
`Lean.Internal.coeM` | ||
-/ | ||
#check (m : IO Nat) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
do | ||
let a ← liftM m | ||
pure a.val : ReaderT Int IO Nat | ||
do | ||
let a ← m | ||
pure a.val : EIO IO.Error Nat |