let to_list t =
  List.rev (fold ~init:[] ~f:(fun l b -> b::l) t)