spacepaste

  1.  
  2. type x = Bool of bool | Int of int;;
  3. let rec to_formatter ff o =
  4. let pf = Format.fprintf ff in
  5. let _ = match o with
  6. | Bool b -> pf "%s" (string_of_bool b)
  7. | Int i -> pf "%d" i
  8. in ();;
  9. (*
  10. Error: This expression has type (int -> 'a, 'b, 'c, 'd, 'd, 'a) format6
  11. but an expression was expected of type
  12. (string -> unit, Format.formatter, unit) format =
  13. (string -> unit, Format.formatter, unit, unit, unit, unit) format6
  14. *)
  15.