.TH "Format.Args" 3 2026-06-22 OCamldoc "OCaml library" .SH NAME Format.Args \- The Args module defines a heterogeneous list type, which can be used as the argument of printf-like functions. .SH Module Module Format.Args .SH Documentation .sp Module .BI "Args" : .B sig end .sp The .ft B Args .ft R module defines a heterogeneous list type, which can be used as the argument of .ft B printf .ft R \-like functions\&. .sp It is not required to open this module when using the functions that accept an .ft B Args\&.t .ft R \&. Thanks to type\-based disambiguation, the type is inferred automatically, so the list syntax .ft B [x; y; z] .ft R can be used directly for heterogeneous lists\&. .sp An example: .EX .ft B .br \& (* without opening Args *) .br \& Format\&.lprintf "%s %d %\&.02f@\&." [ "ocaml"; 42; 3\&.14 ] .br \& .br \& (* or with explicit construction *) .br \& let lst = let open Format\&.Args in "ocaml" :: [ 42; 3\&.14 ] @ [ \&'c\&' ] in .br \& Format\&.lprintf "%s %d %\&.02f %c@\&." lst .br \& .ft R .EE .sp .B "Since" 5.5 .sp .sp .sp .I type .B ('a, 'r) .I t = | [] .B : .B ('r0, 'r0) t | (::) .B : .B 'a0 * ('b, 'r1) t .B -> .B ('a0 -> 'b, 'r1) t .sp .sp .I val apply : .B 'a -> ('a, 'r) t -> 'r .sp .sp .I val (@) : .B ('a, 'r1) t -> .B ('r1, 'r2) t -> ('a, 'r2) t .sp .sp