|
15 | 15 | ```text |
16 | 16 | / |
17 | 17 | ├── build/ – FAKE build scripts and release automation |
| 18 | +│ └── check-order.fsx – checks the category order of the signature files |
18 | 19 | ├── docsSrc/ – FSharp.Formatting documentation source |
19 | 20 | ├── src/FSharp.Collections.Immutable/ – main library |
20 | | -│ ├── Helper.fs |
21 | | -│ ├── ComputationExpressions.fs |
| 21 | +│ ├── Helper.fs – argument checks and exceptions shared by the modules |
22 | 22 | │ ├── FlatList/ – ImmutableArray API surface and builders |
23 | | -│ │ ├── FlatList.fs / FlatList.fsi |
| 23 | +│ │ ├── FlatList.fs / FlatList.fsi – includes the nested Parallel module |
| 24 | +│ │ ├── FlatListOption.fs / FlatListOption.fsi – Option namespace overrides |
| 25 | +│ │ ├── FlatListTuple.fs / FlatListTuple.fsi – Tuple namespace overrides |
24 | 26 | │ │ ├── FlatListBuilder.fs |
25 | 27 | │ │ └── FlatListCE.fs |
26 | 28 | │ ├── IndexedList/ – ImmutableList API surface and builders |
27 | | -│ │ ├── IIndexedList.fs / IIndexedList.fsi |
28 | | -│ │ ├── IndexedList.fs / IndexedList.fsi |
| 29 | +│ │ ├── IndexedList.fs / IndexedList.fsi (+ Option / Tuple) |
| 30 | +│ │ ├── IIndexedList.fs / IIndexedList.fsi (+ Option / Tuple) |
29 | 31 | │ │ ├── IndexedListBuilder.fs |
30 | 32 | │ │ └── IndexedListCE.fs |
31 | 33 | │ ├── Queue/ – ImmutableQueue API surface and CE |
32 | | -│ │ ├── IQueue.fs / IQueue.fsi |
33 | | -│ │ ├── Queue.fs / Queue.fsi |
| 34 | +│ │ ├── Queue.fs / Queue.fsi (+ Option / Tuple) |
| 35 | +│ │ ├── IQueue.fs / IQueue.fsi (+ Option / Tuple) |
34 | 36 | │ │ └── QueueCE.fs |
35 | 37 | │ ├── Stack/ – ImmutableStack API surface and CE |
36 | | -│ │ ├── IStack.fs / IStack.fsi |
37 | | -│ │ ├── Stack.fs / Stack.fsi |
| 38 | +│ │ ├── Stack.fs / Stack.fsi (+ Option / Tuple) |
| 39 | +│ │ ├── IStack.fs / IStack.fsi (+ Option / Tuple) |
38 | 40 | │ │ └── StackCE.fs |
39 | 41 | │ ├── HashMap/ – ImmutableDictionary API surface and CE |
40 | | -│ │ ├── IHashMap.fs / IHashMap.fsi |
41 | | -│ │ ├── HashMap.fs / HashMap.fsi |
| 42 | +│ │ ├── HashMap.fs / HashMap.fsi (+ Option / Tuple) |
| 43 | +│ │ ├── IMap.fs / IMap.fsi (+ Option / Tuple) |
42 | 44 | │ │ └── HashMapCE.fs |
43 | 45 | │ ├── SortedMap/ – ImmutableSortedDictionary API surface and CE |
44 | | -│ │ ├── ISortedMap.fs / ISortedMap.fsi |
45 | | -│ │ ├── SortedMap.fs / SortedMap.fsi |
| 46 | +│ │ ├── SortedMap.fs / SortedMap.fsi (+ Option / Tuple) |
46 | 47 | │ │ └── SortedMapCE.fs |
47 | 48 | │ ├── HashSet/ – ImmutableHashSet API surface and CE |
48 | | -│ │ ├── IHashSet.fs / IHashSet.fsi |
49 | | -│ │ ├── HashSet.fs / HashSet.fsi |
| 49 | +│ │ ├── HashSet.fs / HashSet.fsi (+ Option / Tuple) |
| 50 | +│ │ ├── ISet.fs / ISet.fsi (+ Option / Tuple) |
50 | 51 | │ │ └── HashSetCE.fs |
51 | | -│ └── SortedSet/ – ImmutableSortedSet API surface and CE |
52 | | -│ ├── ISortedSet.fs / ISortedSet.fsi |
53 | | -│ ├── SortedSet.fs / SortedSet.fsi |
54 | | -│ └── SortedSetCE.fs |
| 52 | +│ ├── SortedSet/ – ImmutableSortedSet API surface and CE |
| 53 | +│ │ ├── SortedSet.fs / SortedSet.fsi (+ Option / Tuple) |
| 54 | +│ │ └── SortedSetCE.fs |
| 55 | +│ ├── FrozenMap/ – FrozenDictionary API surface and CE |
| 56 | +│ │ ├── FrozenMap.fs / FrozenMap.fsi (+ Option / Tuple) |
| 57 | +│ │ └── FrozenMapCE.fs |
| 58 | +│ ├── FrozenSet/ – FrozenSet API surface and CE |
| 59 | +│ │ ├── FrozenSet.fs / FrozenSet.fsi (+ Option / Tuple) |
| 60 | +│ │ └── FrozenSetCE.fs |
| 61 | +│ └── ComputationExpressions.fs – the computation expression instances |
55 | 62 | └── tests/FSharp.Collections.Immutable.Tests/ – MSTest test project |
56 | | - ├── HelperTests.fs |
57 | 63 | ├── TestCategories.fs – centralized custom test category attributes |
58 | | - ├── FlatList/ – focused test files per operation group |
59 | | - ├── IndexedList/ – focused test files per operation group |
60 | | - ├── HashMap/ – focused test files per operation group |
61 | | - ├── SortedMap/ – focused test files per operation group |
62 | | - ├── HashSet/ – focused test files per operation group |
63 | | - ├── SortedSet/ – focused test files per operation group |
64 | | - ├── Queue/ – focused test files per operation group |
65 | | - └── Stack/ – focused test files per operation group |
| 64 | + ├── TestCategoriesTests.fs – enforces the test category rules |
| 65 | + ├── Contracts/ – shared contract bases, inputs and assertion helpers |
| 66 | + └── <Collection>/ – ops records, contract classes, collection-specific, |
| 67 | + builder, computation expression, Option and Tuple tests |
66 | 68 | ``` |
67 | 69 |
|
| 70 | +The modules follow ADR 0001 – Per-collection modules (`docsSrc/Explanations/ADR_0001_Collection_Modules.md`): |
| 71 | + |
| 72 | +* Each module groups its functions under banner comments `// ---- Category ----` in the order `Creation`, `Builder`, |
| 73 | + `Properties`, `Access`, `Search`, `Transformation`, `Folding`, `Partitioning and grouping`, `Sorting`, `Random`, |
| 74 | + `Conversion`, `Type-specific`, and sorts the functions of a category alphabetically (ordinal), active patterns last. |
| 75 | + The `.fs` file repeats the order of its `.fsi` file. `build/check-order.fsx` (FAKE target `CheckOrder`) enforces it. |
| 76 | +* `try*` functions return `voption`, tuples are struct tuples. The namespaces `FSharp.Collections.Immutable.Option` and |
| 77 | + `FSharp.Collections.Immutable.Tuple` repeat these functions with `option` results and reference tuples. |
| 78 | +* A function throws what the FSharp.Core function of the mirrored module throws for the same input: `Array` for |
| 79 | + `FlatList`, `List` for the other sequence-like modules, `Map` and `Set` for maps and sets. |
| 80 | +* Contract test bases in `Contracts/` take a record of the module's functions; a collection derives one test class per |
| 81 | + capability that it supports. Expected values and exceptions come from FSharp.Core. |
| 82 | + |
68 | 83 | ## Libraries in Use |
69 | 84 |
|
70 | 85 | * [`System.Collections.Immutable`](https://www.nuget.org/packages/System.Collections.Immutable/) – immutable collections foundation |
|
0 commit comments