Skip to content

Commit 35d5add

Browse files
committed
chore: add My_opt.map to src-bs/decoders_util.ml
1 parent 221f37b commit 35d5add

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src-bs/decoders_util.ml

+3-1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ end
2424
module My_opt = struct
2525
let return x = Some x
2626

27+
let map f x = Belt.Option.map x f
28+
2729
let flat_map f x = Belt.Option.flatMap x f
2830
end
2931

@@ -37,7 +39,7 @@ module My_list = struct
3739
let find_map f xs =
3840
xs
3941
|. Belt.List.getBy (fun x ->
40-
match f x with Some _ -> true | None -> false)
42+
match f x with Some _ -> true | None -> false )
4143
|. Belt.Option.flatMap f
4244

4345

src-bs/decoders_util.mli

+2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ end
1919
module My_opt : sig
2020
val return : 'a -> 'a option
2121

22+
val map : ('a -> 'b) -> 'a option -> 'b option
23+
2224
val flat_map : ('a -> 'b option) -> 'a option -> 'b option
2325
end
2426

0 commit comments

Comments
 (0)