Skip to content

Commit df0d201

Browse files
committed
Define Data Collections used in the spec
1 parent b5ecff0 commit df0d201

File tree

2 files changed

+37
-2
lines changed

2 files changed

+37
-2
lines changed

spec/Appendix A -- Notation Conventions.md

+31
Original file line numberDiff line numberDiff line change
@@ -216,3 +216,34 @@ Fibonacci(number):
216216
Note: Algorithms described in this document are written to be easy to
217217
understand. Implementers are encouraged to include equivalent but optimized
218218
implementations.
219+
220+
## Data Collections
221+
222+
This specification describes the semantic properties of data collections using
223+
types like "list", "set" and "map". These describe observable data collections
224+
such as the result of applying a grammar and the inputs and outputs of
225+
algorithms. They also describe unobservable data collections such as temporary
226+
data internal to an algorithm. Each data collection type defines the operations
227+
available, and whether values are unique or ordered.
228+
229+
**List**
230+
231+
:: The term _list_ describes a sequence of values which may not be unique. A
232+
list is ordered unless explicitly stated otherwise (as an "unordered list"). For
233+
clarity the term "ordered list" may be used when an order is semantically
234+
important.
235+
236+
**Set**
237+
238+
:: The term _set_ describes a unique collection of values, where each value is
239+
considered a "member" of that set. A set is unordered unless explicitly stated
240+
otherwise (as an "ordered set"). For clarity the term "unordered set" may be
241+
used when the lack of an order is semantically important.
242+
243+
**Map**
244+
245+
:: The term _map_ describes a collection of "entry" key and value pairs, where
246+
the set of keys across all entries is unique but the values across all entries
247+
may repeat. A map is unordered unless explicitly stated otherwise (as an
248+
"ordered map"). For clarity the term "unordered map" may be used when the lack
249+
of an order is semantically important.

spec/GraphQL.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,14 @@ Conformance requirements expressed as algorithms can be fulfilled by an
9292
implementation of this specification in any way as long as the perceived result
9393
is equivalent. Algorithms described in this document are written to be easy to
9494
understand. Implementers are encouraged to include equivalent but optimized
95-
implementations.
95+
implementations. Similarly, data collections such as _list_, _set_ and _map_
96+
also introduce conformance requirements. Implementers are free to use
97+
alternative data collections as long as the perceived result remains equivalent.
9698

9799
See [Appendix A](#sec-Appendix-Notation-Conventions) for more details about the
98-
definition of algorithms and other notational conventions used in this document.
100+
definition of algorithms and other notational conventions used in this document,
101+
and [Appendix A: Data Collections](#sec-Data-Collections) for specifics of data
102+
collections and their ordering.
99103

100104
**Non-Normative Portions**
101105

0 commit comments

Comments
 (0)