I’m reading RWO v2 and try to write my own demo as:
open Base
open Stdio
let f1 n =
if n < 10 then None else Some n
let f2 n =
if n > 15 then None else Some n
let combines n =
let open Option.Let_syntax in
let%bind r1 = f1 n in
let%bind r2 = f2 n in
Some r2
let _ =
match combines 13 with
| Some x -> print_int x
| None -> print_endline "nothing"
AFAIK you should have ppx_let installed (via opam install ppx_let if haven’t transitively depended), and add the preprocess stanza on your jbuild file, as such:
In general, the ppx syntax extensions used in RWO are all transitively included by ppx_jane, so using that in your jbuild file should fix it for [@@deriving sexp], [%compare: int list], etc.