as_min_length 3 &quot;Name is too short&quot;)

let validator_email =
  let open Validator in
  option_is_some &quot;Missing email&quot;
  |&gt; compose (string_is_email &quot;Not an email&quot;)

let validator_age =
  let open Validator in
  int_min 13 &quot;Must be 13&quot;

let validator (input: input_form) =
  let open Validator in
  build build_valid_form
  |&gt; validate input.name validator_name
  |&gt; validate input.email validator_email
  |&gt; validate input.age validator_age

validator { name = 