Type-safe codecs for the dune-format file family