[MLton] mlton-lib documentation
Matthew Fluet
fluet@cs.cornell.edu
Thu, 8 Jan 2004 09:01:08 -0500 (EST)
> I think it may be better to strive for consistency in
> naming conventions and signatures without any automated support. The
> SML Basis Library shows that that kind of consistency isn't too hard.
I agree. One thing that I have found annoying about lib/mlton (which
would be somewhat alleviated by includes) is functions missing in similar
structures. For example, LIST has:
val foreach: 'a t * ('a -> unit) -> unit
val foreachi: 'a t * (int * 'a -> unit) -> unit
val foreach2: 'a t * 'b t * ('a * 'b -> unit) -> unit
while VECTOR has:
val foreach: 'a t * ('a -> unit) -> unit
val foreachi: 'a t * (int * 'a -> unit) -> unit
val foreach2: 'a t * 'b t * ('a * 'b -> unit) -> unit
val foreachi2: 'a t * 'b t * (int * 'a * 'b -> unit) -> unit
val foreach3: 'a t * 'b t * 'c t * ('a * 'b * 'c -> unit) -> unit
If we had a FOREACH_SEQ signature, then we could keep them in sync.
Of course, LIST and VECTOR aren't likely to be candidates for exporting to
the world, so it's probably a moot point.