let pp_dim fmt = function
         | None -> Format.pp_print_string fmt "[]"
         | Some d -> Format.fprintf fmt "[%d]" d