From 24d7fab85b2eb1b7996fd0ceccdd0377f1ce087b Mon Sep 17 00:00:00 2001
From: Andreas Grois <andi@grois.info>
Date: Fri, 1 Dec 2023 23:21:14 +0100
Subject: Day 1

---
 Common/Option.lean | 7 +++++++
 1 file changed, 7 insertions(+)
 create mode 100644 Common/Option.lean

(limited to 'Common/Option.lean')

diff --git a/Common/Option.lean b/Common/Option.lean
new file mode 100644
index 0000000..23ea8d6
--- /dev/null
+++ b/Common/Option.lean
@@ -0,0 +1,7 @@
+namespace Option
+
+def zip (a : Option α) (b : Option β) : Option (α×β) := a >>= λ a ↦ b >>= λ b ↦ (a,b)
+
+def unzip : (a : Option (α×β)) → (Option α) × (Option β)
+| none => (none, none)
+| some (a, b) => (some a, some b)
-- 
cgit v1.2.3

