Skip to content

Define Data Collections used in the spec #1102

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 33 additions & 2 deletions spec/Appendix A -- Notation Conventions.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,5 +214,36 @@ Fibonacci(number):
- Return {Fibonacci(previousNumber)} + {Fibonacci(previousPreviousNumber)}.

Note: Algorithms described in this document are written to be easy to
understand. Implementers are encouraged to include equivalent but optimized
implementations.
understand. Implementers are encouraged to include observably equivalent but
optimized implementations.

## Data Collections

Algorithms within this specification refer to abstract data collection types to
express normative structural, uniqueness, and ordering requirements. Temporary
data collections internal to an algorithm use these types to best describe
expected behavior, but implementers are encouraged to provide observably
equivalent but optimized implementations. Implementations may use any data
structure as long as the expected requirements are met.

**List**

:: A _list_ is an ordered collection of values which may contain duplicates. A
value added to a list is ordered after existing values.

**Set**

:: A _set_ is a collection of values which must not contain duplicates.

:: An _ordered set_ is a set which has a defined order. A value added to an
ordered set, which does not already contain that value, is ordered after
existing values.

**Map**

:: A _map_ is a collection of entries, each of which has a key and value. Each
entry has a unique key, and can be directly referenced by that key.

:: An _ordered map_ is a map which has a defined order. An entry added to an
ordered map, which does not have an entry with that key, is ordered after
existing entries.
13 changes: 7 additions & 6 deletions spec/GraphQL.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,15 @@ algorithm step (e.g. "Let completedResult be the result of calling
CompleteValue()") is to be interpreted as having at least the same level of
requirement as the algorithm containing that step.

Conformance requirements expressed as algorithms can be fulfilled by an
implementation of this specification in any way as long as the perceived result
is equivalent. Algorithms described in this document are written to be easy to
understand. Implementers are encouraged to include equivalent but optimized
implementations.
Conformance requirements expressed as algorithms and data collections can be
fulfilled by an implementation of this specification in any way as long as the
perceived result is equivalent. Algorithms described in this document are
written to be easy to understand. Implementers are encouraged to include
equivalent but optimized implementations.

See [Appendix A](#sec-Appendix-Notation-Conventions) for more details about the
definition of algorithms and other notational conventions used in this document.
definition of algorithms, data collections, and other notational conventions
used in this document.

**Non-Normative Portions**

Expand Down