File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -1005,6 +1005,27 @@ noncomputable instance [Nonempty ε] : CCPO (EIO ε α) :=
10051005noncomputable instance [Nonempty ε] : MonoBind (EIO ε) :=
10061006 inferInstanceAs (MonoBind (EST ε IO.RealWorld))
10071007
1008+ instance : CCPO (IO α) :=
1009+ inferInstanceAs (CCPO ((s : _) → FlatOrder (.error Inhabited.default (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+
10081029end mono_bind
10091030
10101031section implication_order
You can’t perform that action at this time.
0 commit comments