Skip to content

Commit e49a394

Browse files
xperiandriclaude
andcommitted
docs: root modules, Comparable* structs and map creation overloads in ADR 0001
The review of the HashMap pull request (#30) changes three parts of the design: - D2: a file with one module declares it as the root module of the file; the type abbreviations of a folder move to `XTypes.fsi`/`XTypes.fs`, because a root module cannot declare a type of its namespace. Modules carry no `[<CompiledName>]`. - D12 (new): the comparers that a map or a set keeps come only through one `Comparable*` struct per collection, whose members are the creation functions with the comparers applied. It replaces the `*WithComparer(s)`, `*WithKeyComparer` and `with*Comparer(s)` functions. - D13 (new): `ofArray`, `ofList` and `ofSeq` of the maps are static extension members in an `[<AutoOpen>]` `XExtensions` module, overloaded for `KeyValuePair`, reference tuples and struct tuples. `ofKeyValuePairs` and the `Tuple` creation functions go; `setItems` takes struct tuples like `addRange`. The ADR also records what the implementation found: the explicit type parameters of the alternate lookups (FS0687), the `comparison` constraint and the cached default comparer of the sorted collections, the O(n) `maxKeyValue` of `SortedMap`, and why `keys`/`values` return different types. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent f141cd1 commit e49a394

1 file changed

Lines changed: 164 additions & 38 deletions

File tree

0 commit comments

Comments
 (0)