This is an ongoing project, comprised of modules facilitating functionality I find useful or interesting during the course of my experiments with SML.
sources.cm
- The SML/NJ Compilation Manager (thus
.cm
) description file that packages all the modules as a library. Users can include this library in their own projects in two ways:- For nontrivial projects, add it as member of the description file for the project, as described in the SML/NJ CM manual (pdf), p. 6.
- For simple projects, the user can make this library available directly from
the SML source file by making the member modules available for
auto-loading. To do this, call
CM.autoload "<path here>/sml-utils/sources.cm";
in the source file before calling the library’s modules.
array-slice-plus.sml
- Defines the module
ArraySlicePlus
, which extends theArraySlice
module from the basis library, enabling more declarative use of array slices. You can see an example of this module in action in my study of in-place quicksort. dict-pairs.sml
- Defines the module
DictPairs
, providing functions on pairs of lists used as a key-value store. collection.sml
- Strives to define a common interface for collection types.
file.sml
- Defines the module
File
, which will collect functions operating on files. graph.sml
- A parametric graph library, which can define and operate on graphs, digraphs, or multi-graphs, depending on the parameters supplied.
iou.sml
- Defines the module
IOU
, which will collect input/output utilities. It’s barren at the moment. list-plus.sml
- Defines the module
ListPlus
, which extends the List module in the SML basis library. number.sml
- Defines a common interface for numbers (ints, reals etc).
ordered.sml
- Defines modules for ordered types, including sub-types like bounded orders, enumerable orders, and cyclical orders.
pair.sml
- Defines the module
Pair
, providing functions on tuples, including ways of constructing, mapping into, accessing, and displaying tuples. petitest.sml
- Defines the module
PetiTest
, a very petite tool for testing. Likely the most petite possible. rand-c.sml
- Defines the module
RandC
, providing random operations on any collection that can be transformed to and from a list. random-plus.sml
- Defines modules facilitating the generation of simple random values.
shell.sml
- Defines the module
Shell
, which provides a few functions for moving around directories and listing files. stack.sml
- Defines modules for monomorphic and polymorphic stacks.