Skip to content

Commit 9bf5cff

Browse files
committed
Quick hack for an IO instance
1 parent 9f30a23 commit 9bf5cff

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

src/Init/Internal/Order/Basic.lean

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1005,6 +1005,27 @@ noncomputable instance [Nonempty ε] : CCPO (EIO ε α) :=
10051005
noncomputable instance [Nonempty ε] : MonoBind (EIO ε) :=
10061006
inferInstanceAs (MonoBind (EST ε IO.RealWorld))
10071007

1008+
instance : CCPO (IO α) :=
1009+
inferInstanceAs (CCPO ((s : _) → FlatOrder (.error (.userError "csup ∅") (Classical.choice ⟨s⟩))))
1010+
1011+
instance : MonoBind IO where
1012+
bind_mono_left {_ _ a₁ a₂ f} h₁₂ := by
1013+
intro s
1014+
specialize h₁₂ s
1015+
change FlatOrder.rel (a₁.bind f s) (a₂.bind f s)
1016+
simp only [EST.bind]
1017+
generalize a₁ s = a₁ at h₁₂; generalize a₂ s = a₂ at h₁₂
1018+
cases h₁₂
1019+
· exact .bot
1020+
· exact .refl
1021+
bind_mono_right {_ _ a f₁ f₂} h₁₂ := by
1022+
intro w
1023+
change FlatOrder.rel (a.bind f₁ w) (a.bind f₂ w)
1024+
simp only [EST.bind]
1025+
split
1026+
· apply h₁₂
1027+
· exact .refl
1028+
10081029
end mono_bind
10091030

10101031
section implication_order

0 commit comments

Comments
 (0)