Mercurial > hg > Papers > 2015 > atton-thesis
view src/monad_laws.agda @ 57:5f0e13923cfd
Fixes
author | Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 16 Feb 2015 16:24:42 +0900 |
parents | b7e693b6d7d9 |
children |
line wrap: on
line source
record Monad {l : Level} (T : Set l -> Set l) (F : Functor T) : Set (suc l) where field -- category mu : {A : Set l} -> T (T A) -> T A eta : {A : Set l} -> A -> T A field -- natural transformations eta-is-nt : {A B : Set l} -> (f : A -> B) -> (x : A) -> (eta ∙ f) x ≡ fmap F f (eta x) mu-is-nt : {A B : Set l} -> (f : A -> B) -> (x : T (T A)) -> mu (fmap F (fmap F f) x) ≡ fmap F f (mu x) field -- category laws association-law : {A : Set l} -> (x : (T (T (T A)))) -> (mu ∙ (fmap F mu)) x ≡ (mu ∙ mu) x left-unity-law : {A : Set l} -> (x : T A) -> (mu ∙ (fmap F eta)) x ≡ id x right-unity-law : {A : Set l} -> (x : T A) -> id x ≡ (mu ∙ eta) x