2424
2525/*** Contains functionality for dealing with values that can be both `null` and `undefined` */
2626
27- @unboxed /** Local alias for `Js.null_undefined('a) `. */
27+ @unboxed /** Local alias for `Js.null_undefined<'a> `. */
2828type t <+ 'a > = Js .nullable <'a > =
2929 | Value ('a )
3030 | @as (null ) Null
3131 | @as (undefined ) Undefined
3232
33- /** Constructs a value of `Js.null_undefined('a) ` containing a value of `'a`. */
33+ /** Constructs a value of `Js.null_undefined<'a> ` containing a value of `'a`. */
3434external return : 'a => t <'a > = "%identity"
3535
3636/** Returns `true` if the given value is null or undefined, `false` otherwise. */
3737external isNullable : t <'a > => bool = "#is_nullable"
3838
39- /** The null value of type `Js.null_undefined('a) `. */
39+ /** The null value of type `Js.null_undefined<'a> `. */
4040external null : t <'a > = "#null"
4141
42- /** The undefined value of type `Js.null_undefined('a) `. */
42+ /** The undefined value of type `Js.null_undefined<'a> `. */
4343external undefined : t <'a > = "#undefined"
4444
4545/**
4646Maps the contained value using the given function.
4747
48- If `Js.null_undefined('a) ` contains a value, that value is unwrapped, mapped to
48+ If `Js.null_undefined<'a> ` contains a value, that value is unwrapped, mapped to
4949a `'b` using the given function `a' => 'b`, then wrapped back up and returned
50- as `Js.null_undefined('b) `.
50+ as `Js.null_undefined<'b> `.
5151
5252```res example
5353let maybeGreetWorld = (maybeGreeting: Js.null_undefined<string>) =>
@@ -58,7 +58,7 @@ let bind: (t<'a>, (. 'a) => 'b) => t<'b>
5858
5959/**
6060Iterates over the contained value with the given function.
61- If `Js.null_undefined('a) ` contains a value, that value is unwrapped and applied to the given function.
61+ If `Js.null_undefined<'a> ` contains a value, that value is unwrapped and applied to the given function.
6262
6363```res example
6464let maybeSay = (maybeMessage: Js.null_undefined<string>) =>
@@ -68,7 +68,7 @@ let maybeSay = (maybeMessage: Js.null_undefined<string>) =>
6868let iter : (t <'a >, (. 'a ) => unit ) => unit
6969
7070/**
71- Maps `option('a) ` to `Js.null_undefined('a) `.
71+ Maps `option<'a> ` to `Js.null_undefined<'a> `.
7272`Some(a)` => `a`
7373`None` => `undefined`
7474*/
@@ -77,7 +77,7 @@ let fromOption: option<'a> => t<'a>
7777@deprecated ("Use fromOption instead" ) let from_opt : option <'a > => t <'a >
7878
7979/**
80- Maps `Js.null_undefined('a) ` to `option('a) `.
80+ Maps `Js.null_undefined<'a> ` to `option<'a> `.
8181`a` => `Some(a)`
8282`undefined` => `None`
8383`null` => `None`
0 commit comments