Skip to content

Commit

Permalink
Curryfication & uncurryfication
Browse files Browse the repository at this point in the history
  • Loading branch information
vbgl committed May 21, 2019
1 parent b9ab916 commit 18411f0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/datatypes.v
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,12 @@ Lemma pairI (A B: Type) (p q: A * B) (e: p = q) :
let: (a, b) := p in a = q.1 /\ b = q.2.
Proof. exact: (let: eq_refl := e in and_intro eq_refl eq_refl). Qed.

Definition prod_uncurry (A B C: Type) (f: A * B -> C) (a: A) (b: B) : C :=
f (a, b).

Definition prod_curry (A B C: Type) (f: A -> B -> C) (p: A * B) : C :=
let: (a, b) := p in f a b.

(** [(sig A P)], or more suggestively [{x:A | P x}], denotes the subset
of elements of the type [A] which satisfy the predicate [P].
Similarly [(sig2 A P Q)], or [{x:A | P x & Q x}], denotes the subset
Expand Down

0 comments on commit 18411f0

Please sign in to comment.