Not able to pretty print abstract type with parameters

I have the following Stack module:

module type STACK = sig
  type 'a t
  exception Empty
  val empty : 'a t
  val push : 'a -> 'a t -> 'a t
  val ppf :
      (Format.formatter -> 'a -> unit) -> Format.formatter -> 'a t -> unit

module ListStack : STACK = struct
  type 'a t = 'a list
  exception Empty
  let empty = []
  let push x s  = x :: s
  let ppf elt fmt s =
    let open Format in
    let pp_break fmt () = fprintf fmt "[@," in
    pp_print_list ~pp_sep:pp_break elt fmt s

let stack = ListStack.(empty |> push 1)

I’m not able to figure out a way to print my stack,

let () = printf "%a" ListStack.ppf stack

gives errors, is there proper way to print it?

Since your type is a polymorphic container, you need to provide a way for the printer to print the elements inside the container:

let () = Format.printf "%a@." (ListStack.ppf Format.pp_print_int) stack