package env_config

  1. Overview
  2. Docs

Source file deserializers.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
open! Core

module Make (Configuration : Configuration_intf.S) = struct
  let safe_t_of_sexp =
    if Configuration.allow_extra_fields
    then Sexp.of_sexp_allow_extra_fields_recursively
    else Fn.id
  ;;

  let deserialize t_of_sexp x =
    Or_error.try_with (fun () -> safe_t_of_sexp t_of_sexp (Sexp.of_string x))
  ;;
end
OCaml

Innovation. Community. Security.