package server-reason-react

  1. Overview
  2. Docs
Rendering React components on the server natively

Install

dune-project
 Dependency

Authors

Maintainers

Sources

server-reason-react-0.4.1.tbz
sha256=2d27cb4656208dde8d5eb0c452c590186d092618ac0a04f1ab0a095a3ca58498
sha512=26e16daf87f6b80eff86ccf7df29153527b24e3f4dbc7f13820d1507b0a2e7d6db40fd774bcaad6e6cccff0bf19d4a411b95a10a071f9ce92d52bf07eb08f75f

doc/src/server-reason-react.js/Js_nullable.ml.html

Source file Js_nullable.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
type 'a t = 'a option

external toOption : 'a t -> 'a option = "%identity"
external to_opt : 'a t -> 'a option = "%identity"

let return : 'a -> 'a t = fun x -> Some x
let isNullable : 'a t -> bool = function Some _ -> false | None -> true
let null : 'a t = None
let undefined : 'a t = None
let bind x f = match to_opt x with None -> ((x : 'a t) : 'b t) | Some x -> return (f x)
let iter x f = match to_opt x with None -> () | Some x -> f x
let fromOption x = match x with None -> undefined | Some x -> return x
let from_opt = fromOption