Last active
August 29, 2015 14:09
-
-
Save pelotom/741bf7542bd55a37ecf6 to your computer and use it in GitHub Desktop.
A dependent curry and uncurry.
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
curry : {A : Type} | |
-> {B : A -> Type} | |
-> {C : Sigma A B -> Type} | |
-> ((p : Sigma A B) -> C p) | |
-> (x : A) -> (y : B x) -> C (x ** y) | |
curry f x y = f (x ** y) | |
-- Dependent uncurry is just the induction principle for sigma types | |
uncurry : {A : Type} | |
-> {B : A -> Type} | |
-> {C : Sigma A B -> Type} | |
-> ((x : A) -> (y : B x) -> C (x ** y)) | |
-> (p : Sigma A B) -> C p | |
uncurry f (x ** y) = f x y |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment