let default x ~opt =
  match opt with None -> x | Some y -> y