Skip to content

Commit

Permalink
Remove identity from Option.getUnsafe
Browse files Browse the repository at this point in the history
  • Loading branch information
davesnx committed Aug 2, 2024
1 parent 535a3b4 commit 171bd47
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions packages/Belt/src/Belt_Option.ml
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,4 @@ let keepU opt f =
let keep opt f = keepU opt (fun x -> f x)
let forEachU opt f = match opt with Some x -> f x | None -> ()
let forEach opt f = forEachU opt (fun x -> f x)

external getUnsafe : 'a option -> 'a = "%identity"
let getUnsafe = function Some x -> x | None -> assert false
2 changes: 1 addition & 1 deletion packages/Belt/src/Belt_Option.mli
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ val getExn : 'a option -> 'a
]}
*)

external getUnsafe : 'a option -> 'a = "%identity"
val getUnsafe : 'a option -> 'a
(** [getUnsafe x] returns x
This is an unsafe operation, it assumes x is neither not None
or (Some (None .. ))
Expand Down

0 comments on commit 171bd47

Please sign in to comment.