aoc2020/misc.mli

19 lines
425 B
OCaml

val usage: string -> 'a
val usage_default: int -> 'a
val main: int -> (string -> unit) array -> string list -> unit
type 'a monoid =
{id: 'a;
op: 'a -> 'a -> 'a;
op_name: string;
pp: Format.formatter -> 'a -> unit}
val fold_list: 'a monoid -> 'a list -> 'a
val mult: int monoid
val add: int monoid
val print_fold: 'a monoid -> 'a list -> unit
val print_prod: int list -> unit
val print_sum: int list -> unit