Skip to content

Commit

Permalink
Merge pull request #882 from ROMemories/fix/add-option-map
Browse files Browse the repository at this point in the history
fix(fstar-core): add support for `Option::map`
  • Loading branch information
franziskuskiefer authored Sep 10, 2024
2 parents 5ac5c22 + 69a9ea2 commit 5e3e6d2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions proof-libs/fstar/core/Core.Option.fst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ let impl__and_then #t_Self #t (self: t_Option t_Self) (f: t_Self -> t_Option t):
| Option_Some x -> f x
| Option_None -> Option_None

let impl__map #t_Self #t (self: t_Option t_Self) (f: t_Self -> t): t_Option t =
match self with
| Option_Some x -> Option_Some (f x)
| Option_None -> Option_None

let impl__unwrap #t (x: t_Option t {Option_Some? x}): t = Option_Some?._0 x

let impl__is_some #t_Self (self: t_Option t_Self): bool = Option_Some? self
Expand Down

0 comments on commit 5e3e6d2

Please sign in to comment.