move "Maybe String" to a map in CompoundTag #4

Closed
ghost opened this Issue Dec 10, 2012 · 2 comments

Projects

None yet

0 participants

@ghost
ghost commented Dec 10, 2012

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.

@ghost
ghost commented Dec 10, 2012

I just noticed that the root of an NBT is also always named, which complicates matters.

@ghost
ghost commented Mar 13, 2013

Fixed by merging #5.

@ghost ghost closed this Mar 13, 2013
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment