From 000d958aabe0da72c0d95bb2b20cdc4dddafadc7 Mon Sep 17 00:00:00 2001 From: Leon Vatthauer Date: Fri, 24 Nov 2023 08:30:53 +0100 Subject: [PATCH] minor --- src/Algebra/Elgot.lagda.md | 61 +++++++++++--------- src/Monad/Instance/K/Commutative.lagda.md | 20 ++++++- src/Monad/Instance/K/Instance/Maybe.lagda.md | 51 ++++++++++++++++ 3 files changed, 104 insertions(+), 28 deletions(-) create mode 100644 src/Monad/Instance/K/Instance/Maybe.lagda.md diff --git a/src/Algebra/Elgot.lagda.md b/src/Algebra/Elgot.lagda.md index 3cd050d..291b2bb 100644 --- a/src/Algebra/Elgot.lagda.md +++ b/src/Algebra/Elgot.lagda.md @@ -1,5 +1,6 @@ + +```agda +module Monad.Instance.K.Instance.Maybe {o ℓ e} (ambient : Ambient o ℓ e) where +open Ambient ambient using () +``` + +# The Maybe Monad as instance of K +Assuming the axiom of choice, the maybe monad is an instance of K in the category of setoids. + +```agda +module _ {c ℓ' : Level} where + open Cocartesian (Setoids-Cocartesian {c} {c ⊔ ℓ'}) + open Terminal (terminal {c} {c ⊔ ℓ'}) + open MR (Setoids c (c ⊔ ℓ')) + open Category (Setoids c (c ⊔ ℓ')) + open Equiv + + maybe : Monad (Setoids c (c ⊔ ℓ')) + maybe = record + { F = record + { F₀ = λ X → X + ⊤ + ; F₁ = λ {A} {B} f → f +₁ ⟶-id + ; identity = {! !} + ; homomorphism = {! !} + ; F-resp-≈ = λ {A} {B} {f} {g} f≈g → +₁-cong₂ f≈g ? + } + ; η = {! !} + ; μ = {! !} + ; assoc = {! !} + ; sym-assoc = {! !} + ; identityˡ = {! !} + ; identityʳ = {! !} + } +``` \ No newline at end of file