Last active
August 29, 2015 14:13
-
-
Save tokiwoousaka/193ad9176e6dbd6b2362 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
モナド則: (m >>= g) >>= h == m >>= (\x -> g x >>= h) | |
定義: f >=> g == \x -> f x >>= g | |
命題:(f >=> g) >=> h == f >=> (g >=> h) | |
(f >=> g) >=> h | |
== (\x -> f x >>= g) >=> h -- (>=>)の定義 | |
== \y -> (\x -> f x >>= g) y >>= h -- (>=>)の定義 | |
== \y -> (f y >>= g) >>= h | |
== \y -> f y >>= (\z -> g z >>= h) -- モナド則 | |
== \y -> f y >>= (g >=> h) -- (>=>)の定義 | |
== f >=> (g >=> h) -- (>=>)の定義 | |
よって (f >=> g) >=> h == f >=> (g >=> h) | |
Q.E.D. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
どちらかというとL6に間違いがあったので直しました。
L6からL7へ、(>=>)の定義による変換をご確認ください。ラムダ項 (\x -> f x >>= g) を一旦Xと置くとわかり良いかと思います。