summaryrefslogtreecommitdiff
path: root/Common/Option.lean
diff options
context:
space:
mode:
authorAndreas Grois <andi@grois.info>2024-09-23 21:31:41 +0200
committerAndreas Grois <andi@grois.info>2024-09-23 21:31:41 +0200
commit5d08e39abca75b775bb7636973bb9c9a3bb908ac (patch)
tree99ba141c3d485c17ea261694ea48699d0b9aa441 /Common/Option.lean
parentfda8a5b06d63aaa6b7db2ca7b2a7c0bd321bd16e (diff)
Continue Day12
Diffstat (limited to 'Common/Option.lean')
-rw-r--r--Common/Option.lean4
1 files changed, 4 insertions, 0 deletions
diff --git a/Common/Option.lean b/Common/Option.lean
index 9344d83..f0d43fa 100644
--- a/Common/Option.lean
+++ b/Common/Option.lean
@@ -16,3 +16,7 @@ def bindWithProof (o : Option α) (f : (v : α) → (o = some v) → Option β)
| .none => none
def mapWithProof (o : Option α) (f : (v : α) → (o = some v) → β) : Option β := bindWithProof o (some $ f · ·)
+
+def ofBool : Bool → Option Unit
+ | .false => none
+ | .true => some ()