Skip to content

Commit 870f8b6

Browse files
committed
Manifest design of the Standard Library in its README
1 parent 272b273 commit 870f8b6

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

lib/README.md

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,19 @@ reviewed rigorously rather than depend on the monitor.
2121
To compile a module as part of the standard library, add it to the list of files in the `lib`
2222
target of the *makefile*.
2323

24+
## Design Principles
25+
26+
- File names are written in `CamelCase`. This makes them conform to the Standard ML Basis Library.
27+
- It is more important to match the function names and signatures in the Standard ML library than to
28+
improve on them. For example, `String.sub` would make more sense with the type `[Char] -> Int ->
29+
Char` but to match the SML library, we will stick with `[Char] * Int -> Char`.
30+
- Each module exports a single *record* with the same name as the file. This (1) makes it closer to
31+
the SML module system and (2) allows for name resolution, e.g. `HashMap.findOpt` and
32+
`ListPair.findOpt` can be used in the same file.
33+
- Each function that is exported has to be documented (`(** <text> *)`). In the long run, we will
34+
auto-generate documentation for the Standard Library.
35+
2436
## TODO
2537

26-
- To conform with the Standard ML Basis Library, we should have the files conform to a `CamelCase`
27-
style.
28-
- To fake namespaced import, e.g. `List.length`, the library should export a struct instead. Only
29-
certain functions should "pollute" the global namespace.
30-
- Quite a lot of the standard library is not documented in any way. What is the purpose of each
31-
function and each module? The [modules](#modules) above are the ones that have been updated and
32-
documented.
33-
- There are a lot of things in here - some of it dead. Can we merge/remove some things?
38+
The [modules](#modules) mentioned above already follow the [design principles](#design-principles).
39+
The remaining files either need to be updated or to be removed.

0 commit comments

Comments
 (0)