Created
November 29, 2022 22:21
-
-
Save quinn-dougherty/04e5e8ee564a4604549914c258d48cea to your computer and use it in GitHub Desktop.
function types form a monad in exactly one way. (this uses `coq-ext-lib` so you can't roll it in jscoq)
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
| From ExtLib Require Import Monad. | |
| Section ArrowMonad. | |
| Context (A : Type). | |
| Instance CodArrowMonad : Monad (fun B => A -> B). | |
| Proof. | |
| constructor. | |
| - intros B y x. | |
| apply y. | |
| - intros B C alpha Beta x. | |
| specialize (alpha x). | |
| apply (Beta alpha x). | |
| Defined. | |
| (* TODO: impossibility proof of the `Monad (fun B => B -> A)`*) | |
| End ArrowMonad. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment