[MLton] mlton-lib documentation

Matthew Fluet fluet@cs.cornell.edu
Wed, 7 Jan 2004 16:53:59 -0500 (EST)


> I hope to make libraries a major focus for the MLton release after
> this one.  This includes: support for mlb files, file-based dead-code
> elimination in the elaborator, making available some useful libraries
> (DirectedGraph, Hash, Regexp, URL, ... <your request here>), and
> documentation.

Layout?  Only because virtually every other module gives a layout
function.

> One thing I've started thinking about is how to make stuff available
> from lib/mlton as well as the MLton structure of our current basis.  I
> think it would be confusing for users to have these two different
> libraries to choose from.  I further think that lib/mlton is way too
> big, both in the number of things exported, and the sizes of some of
> the signatures.  So, my current thinking as to the way to go is to
> release a combination of what's currently in the MLton structure with
> a subset of lib/mlton.

Certainly lib/mlton is much too big.  One way of dealing with the size of
signatures would be to revisit the design of the lib/mlton
library.  A thought I had, would be to make greater use of include.  For
example:

signature T = sig type t
              end
signature HASHABLE = sig type hashable
                         val hash : hashable -> word
                     end
signature ORDERED = sig type ordered
                        val compare : ordered -> order
                    end
signature EQUALITY = sig type equality
                         val equals : equality * equality -> bool
                     end

signature FOO =
  sig
    include T
    include HASHABLE where type hashable = t
    include ORDERED where type ordered = t
    include EQUALITY where type equality = t
  end

> those stubs would be messy, error prone, and a lot of work.  So my
> current thinking is that we should keep development of the MLton
> compiler, the MLton structure, and the MLton library in close
> synchronization.

Makes sense.