File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change 1
1
// Generated by ReScript, PLEASE EDIT WITH CARE
2
2
3
+ import * as Curry from "rescript/lib/es6/curry.js" ;
3
4
import * as Caml_option from "rescript/lib/es6/caml_option.js" ;
4
5
5
6
function fromOption ( option ) {
@@ -28,9 +29,17 @@ function getExn(value) {
28
29
} ;
29
30
}
30
31
32
+ function map ( value , f ) {
33
+ if ( ! ( value == null ) ) {
34
+ return Curry . _1 ( f , value ) ;
35
+ }
36
+
37
+ }
38
+
31
39
export {
32
40
fromOption ,
33
41
getWithDefault ,
34
42
getExn ,
43
+ map ,
35
44
}
36
45
/* No side effect */
Original file line number Diff line number Diff line change @@ -27,3 +27,9 @@ let getExn: t<'a> => 'a = value =>
27
27
}
28
28
29
29
external getUnsafe : t <'a > => 'a = "%identity"
30
+
31
+ let map = (value , f ) =>
32
+ switch value -> toOption {
33
+ | Some (x ) => make (f (x ))
34
+ | None => undefined
35
+ }
You can’t perform that action at this time.
0 commit comments