If you read the specification carefully, there is only one place where named tags can exist: inside compound tags. There are two tags which can contain other nodes, i.e. lists and compounds, and lists only contains unnamed tags. The root of any NBT file is also unnamed. Furthermore, within a compound tag, names must be unique.
So I propose the removal the Maybe String field in every node, and put a Data.Map.Map String NBT in CompoundTag instead of a [NBT]. This adds another dependency for this package (containers), but it's a commonly used package, so that should be fine.
If you read the specification carefully, there is only one place where named tags can exist: inside compound tags. There are two tags which can contain other nodes, i.e. lists and compounds, and lists only contains unnamed tags. The root of any NBT file is also unnamed. Furthermore, within a compound tag, names must be unique.
So I propose the removal the
Maybe String
field in every node, and put aData.Map.Map String NBT
inCompoundTag
instead of a[NBT]
. This adds another dependency for this package (containers
), but it's a commonly used package, so that should be fine.