Extraction of pattern contained in driver
The following example:
use list.List
type t = T (list int)
let f (t: t) = match t with T (Cons x Nil) -> x | _ -> absurd end
gets extracted to:
type t =
| T of (Z.t) list
let f (t1: t) : Z.t =
match t1 with
| T x :: [] -> x
| _ -> assert false (* absurd *)
Since Cons
is defined in the driver as %1 :: %2
, the OCaml printer does not put the needed parentheses around x :: []
.