[MLton-devel] cvs commit:
Matthew Fluet
fluet@users.sourceforge.net
Sat, 20 Jul 2002 16:59:02 -0700
fluet 02/07/20 16:59:01
Modified: basis-library Tag: basis-2002 build-basis
basis-library/arrays-and-vectors Tag: basis-2002 array.sig
array.sml mono-array.sig mono-array.sml
mono-array2.sml mono-vector.sig mono-vector.sml
sequence.fun sequence.sig vector.sig vector.sml
basis-library/general Tag: basis-2002 bool.sig bool.sml
general.sig general.sml option.sig option.sml
basis-library/integer Tag: basis-2002 int-inf.sig
integer.sig pack32.sml word.sig
basis-library/list Tag: basis-2002 list-pair.sig
list-pair.sml list.sig list.sml
basis-library/real Tag: basis-2002 IEEE-real.sig
IEEE-real.sml math.sig pack-real.sig pack-real.sml
real.sig real.sml
basis-library/top-level Tag: basis-2002 overloads.sml
top-level.sml
doc/user-guide Tag: basis-2002 basis.tex
lib/mlton/pervasive Tag: basis-2002 pervasive.sml
regression Tag: basis-2002 real6.ok real6.sml word.sml
Added: basis-library Tag: basis-2002 notes.txt
basis-library/arrays-and-vectors Tag: basis-2002
array-slice.sig vector-slice.sig
Log:
EMAIL Basis Library updates
This starts a branch "basis-2002" for updating on the latest basis
library specification.
Structures completed so far:
SML90 -- deleted from spec; I've left it in for some of the regressions.
General -- cosmetic
Bool -- cosmetic
Option -- cosmetic
List -- added collate
ListPair -- added exception UnequalLengths, *Eq functions, and collate
Int,Int32,LargeInt -- cosmetic
IntInf -- cosmetic
Word,Word8,Word32 -- added ~; also overloaded ~ at Word and Word8,
although not in spec
IEEEReal -- removed nan_mode, changed record field name in decimal_approx,
semantics of toString
Real -- removed nan_mode, semantics of toString, semantics of scan (now
accepts symbolic names for {+,~}inf and nan)
Math -- cosmetic
Vector/Array -- lots of changes; in particular, new structures VectorSlice and
ArraySlice exist, so Vector/Array.* operations always work
on whole array; Vector/ArraySlice.* operations always work
on a slice. I've marked a few EXTRA functions as
(* Depreciated *) to be removed later and expressed in terms
of the new functions, but keeping them around keeps the size
of check-basis error messages reasonable. There might be a
minor inconsistency in the VECTOR_SLICE and ARRAY_SLICE
signatures; see notes.txt for details.
MONO_VECTOR/MONO_ARRAY -- similar changes as to above; but no slices on mono-sequences.
(The above changes break many of the array and vector regressions.)
Next on the list would be Array2 and then to propagate all the changes
in vectors through to strings. Looking at the new specification, I see
structure CharVector :> MONO_VECTOR
where type vector = String.string
where type elem = Char.char
and
structure String :> STRING
where type string = CharVector.vector
where type char = Char.char
I don't even know if these circular where clauses make semantic sense;
Furthermore, I don't know if this helps or hurts the comments in the
basis implementation of mono-morphic sequences where there are remarks
about the basis library specification requiring "type CharVector.vector = string"
I've also included a file "notes.txt" that documents typos,
incosistencies, and other notes I've taken. Also, see top-level.sml
for some documented differences from the basis spec. Mostly, some
opaque signatures matches that aren't in the spec, but I think should
be.
Much to Steve's chagrin, for ease of comparison, I've reordered the signatures
to match their documented order.
Revision Changes Path
No revision
No revision
1.12.2.1 +2 -0 mlton/basis-library/build-basis
Index: build-basis
===================================================================
RCS file: /cvsroot/mlton/mlton/basis-library/build-basis,v
retrieving revision 1.12
retrieving revision 1.12.2.1
diff -u -r1.12 -r1.12.2.1
--- build-basis 17 Jun 2002 06:28:56 -0000 1.12
+++ build-basis 20 Jul 2002 23:58:59 -0000 1.12.2.1
@@ -15,8 +15,10 @@
list/list-pair.sml
arrays-and-vectors/sequence.sig
arrays-and-vectors/sequence.fun
+arrays-and-vectors/vector-slice.sig
arrays-and-vectors/vector.sig
arrays-and-vectors/vector.sml
+arrays-and-vectors/array-slice.sig
arrays-and-vectors/array.sig
arrays-and-vectors/array.sml
text/string0.sml
No revision
No revision
1.1.2.1 +91 -0 mlton/basis-library/Attic/notes.txt
No revision
No revision
1.3.10.1 +28 -23 mlton/basis-library/arrays-and-vectors/array.sig
Index: array.sig
===================================================================
RCS file: /cvsroot/mlton/mlton/basis-library/arrays-and-vectors/array.sig,v
retrieving revision 1.3
retrieving revision 1.3.10.1
diff -u -r1.3 -r1.3.10.1
--- array.sig 1 Aug 2001 20:04:01 -0000 1.3
+++ array.sig 20 Jul 2002 23:59:00 -0000 1.3.10.1
@@ -8,42 +8,47 @@
include ARRAY_GLOBAL
type 'a vector
-
- val app: ('a -> unit) -> 'a array -> unit
- val appi: (int * 'a -> unit) -> 'a array * int * int option -> unit
+ val maxLen: int
val array: int * 'a -> 'a array
- val copy:
- {src: 'a array, si: int, len: int option, dst: 'a array, di: int}
- -> unit
- val copyVec:
- {src: 'a vector, si: int, len: int option, dst: 'a array, di: int}
- -> unit
- val extract: 'a array * int * int option -> 'a vector
- val foldl: ('a * 'b -> 'b) -> 'b -> 'a array -> 'b
- val foldli:
- (int * 'a * 'b -> 'b) -> 'b -> 'a array * int * int option -> 'b
- val foldr: ('a * 'b -> 'b) -> 'b -> 'a array -> 'b
- val foldri:
- (int * 'a * 'b -> 'b) -> 'b -> 'a array * int * int option -> 'b
val fromList: 'a list -> 'a array
+ val tabulate: int * (int -> 'a) -> 'a array
val length: 'a array -> int
- val maxLen: int
- val modify: ('a -> 'a) -> 'a array -> unit
- val modifyi: (int * 'a -> 'a) -> 'a array * int * int option -> unit
val sub: 'a array * int -> 'a
- val tabulate: int * (int -> 'a) -> 'a array
val update: 'a array * int * 'a -> unit
+ val vector: 'a array -> 'a vector
+ val copy: {src: 'a array, dst: 'a array, di: int} -> unit
+ val copyVec: {src: 'a vector, dst: 'a array, di: int} -> unit
+ val appi: (int * 'a -> unit) -> 'a array -> unit
+ val app: ('a -> unit) -> 'a array -> unit
+ val modifyi: (int * 'a -> 'a) -> 'a array -> unit
+ val modify: ('a -> 'a) -> 'a array -> unit
+ val foldli: (int * 'a * 'b -> 'b) -> 'b -> 'a array -> 'b
+ val foldri: (int * 'a * 'b -> 'b) -> 'b -> 'a array -> 'b
+ val foldl: ('a * 'b -> 'b) -> 'b -> 'a array -> 'b
+ val foldr: ('a * 'b -> 'b) -> 'b -> 'a array -> 'b
+ val findi: (int * 'a -> bool) -> 'a array -> (int * 'a) option
+ val find: ('a -> bool) -> 'a array -> 'a option
+ val exists: ('a -> bool) -> 'a array -> bool
+ val all: ('a -> bool) -> 'a array -> bool
+ val collate: ('a * 'a -> order) -> 'a array * 'a array -> order
+
end
signature ARRAY_EXTRA =
sig
include ARRAY
+ structure ArraySlice: ARRAY_SLICE_EXTRA where type 'a array = 'a array
+ and type 'a vector = 'a vector
- val checkSlice: 'a array * int * int option -> int
- val checkSliceMax: int * int option * int -> int
- val prefixToList: 'a array * int -> 'a list
val toList: 'a array -> 'a list
val unfoldi: int * 'a * (int * 'a -> 'b * 'a) -> 'b array
val unsafeSub: 'a array * int -> 'a
val unsafeUpdate: 'a array * int * 'a -> unit
+
+ (* Depreciated *)
+ val checkSlice: 'a array * int * int option -> int
+ (* Depreciated *)
+ val checkSliceMax: int * int option * int -> int
+ (* Depreciated *)
+ val extract: 'a array * int * int option -> 'a vector
end
1.3.2.1 +54 -39 mlton/basis-library/arrays-and-vectors/array.sml
Index: array.sml
===================================================================
RCS file: /cvsroot/mlton/mlton/basis-library/arrays-and-vectors/array.sml,v
retrieving revision 1.3
retrieving revision 1.3.2.1
diff -u -r1.3 -r1.3.2.1
--- array.sml 10 Apr 2002 07:02:15 -0000 1.3
+++ array.sml 20 Jul 2002 23:59:00 -0000 1.3.2.1
@@ -11,57 +11,72 @@
type 'a elt = 'a
val fromArray = fn a => a
val isMutable = true
- open Primitive.Array)
+ val length = Primitive.Array.length
+ val sub = Primitive.Array.sub)
open A
- open Primitive.Int
-
- local open Primitive.Array
- in val unsafeSub = sub
- val unsafeUpdate = update
- end
type 'a array = 'a array
- type 'a vector = 'a vector
+ type 'a vector = 'a Vector.vector
val array = new
- (* can't use o because of value restriction *)
- val extract = fn arg => Primitive.Vector.fromArray (extract arg)
-
- fun modifyi f (slice as (a, _, _)) =
- appi (fn (i, x) => unsafeUpdate (a, i, f (i, x))) slice
+ structure ArraySlice =
+ struct
+ open Slice
+ type 'a array = 'a array
+ type 'a vector = 'a Vector.vector
+ type 'a vector_slice = 'a Vector.VectorSlice.slice
+ fun update (arr, i, x) =
+ update' Primitive.Array.update (arr, i, x)
+ fun unsafeUpdate (arr, i, x) =
+ unsafeUpdate' Primitive.Array.update (arr, i, x)
+ fun vector sl = map' Vector.tabulate (fn x => x) sl
+ fun modifyi f sl =
+ appi (fn (i, x) => unsafeUpdate (sl, i, f (i, unsafeSub (sl, i)))) sl
+ fun modify f sl = modifyi (f o #2) sl
+ local
+ fun make (length, sub) {src, dst, di} =
+ modifyi (fn (i, _) => sub (src, i))
+ (slice (dst, di, SOME (length src)))
+ in
+ fun copy (arg as {src, dst, di}) =
+ let val (src', si', len') = base src
+ in
+ if src' = dst andalso si' < di andalso si' +? len' >= di
+ then let val sl = slice (dst, di, SOME (length src))
+ in
+ foldri (fn (i, _, _) =>
+ unsafeUpdate (sl, i, unsafeSub (src, i)))
+ () sl
+ end
+ else make (length, unsafeSub) arg
+ end
- fun modify f a = modifyi (f o #2) (wholeSlice a)
+ fun copyVec arg =
+ make (Vector.VectorSlice.length, Vector.VectorSlice.unsafeSub) arg
+ end
+ end
local
- fun make (checkSlice, sub) {src, si, len, dst, di} =
- let
- val sm = checkSlice (src, si, len)
- val diff = si -? di
- in modifyi
- (fn (i, _) => sub (src, i +? diff))
- (dst, di, SOME (sm -? si))
- end
+ fun make f arr = f (ArraySlice.full arr)
in
- fun copy (arg as {src, si, len, dst, di}) =
- if src = dst andalso si < di
- then
- (* Must go right-to-left *)
- let
- val sm = checkSlice (src, si, len)
- val dm = checkSlice (dst, di, SOME (sm -? si))
- fun loop i =
- if i < si then ()
- else (unsafeUpdate (dst, di +? i, unsafeSub (src, i))
- ; loop (i -? 1))
- in loop (sm -? 1)
- end
- else make (checkSlice, unsafeSub) arg
-
- fun copyVec arg =
- make (Vector.checkSlice, Primitive.Vector.sub) arg
+ fun vector arr = make (ArraySlice.vector) arr
+ fun modifyi f = make (ArraySlice.modifyi f)
+ fun modify f = make (ArraySlice.modify f)
+ fun copy {src, dst, di} = ArraySlice.copy {src = ArraySlice.full src,
+ dst = dst, di = di}
+ fun copyVec {src, dst, di} = ArraySlice.copyVec {src = VectorSlice.full src,
+ dst = dst, di = di}
end
+
+ val unsafeSub = Primitive.Array.sub
+ fun update (arr, i, x) = update' Primitive.Array.update (arr, i, x)
+ val unsafeUpdate = Primitive.Array.update
+
+ (* Depreciated *)
+ fun extract args = ArraySlice.vector (ArraySlice.slice args)
end
+structure ArraySlice: ARRAY_SLICE_EXTRA = Array.ArraySlice
structure ArrayGlobal: ARRAY_GLOBAL = Array
open ArrayGlobal
1.1.1.1.10.1 +26 -29 mlton/basis-library/arrays-and-vectors/mono-array.sig
Index: mono-array.sig
===================================================================
RCS file: /cvsroot/mlton/mlton/basis-library/arrays-and-vectors/mono-array.sig,v
retrieving revision 1.1.1.1
retrieving revision 1.1.1.1.10.1
diff -u -r1.1.1.1 -r1.1.1.1.10.1
--- mono-array.sig 18 Jul 2001 05:51:02 -0000 1.1.1.1
+++ mono-array.sig 20 Jul 2002 23:59:00 -0000 1.1.1.1.10.1
@@ -2,35 +2,32 @@
sig
eqtype array
type elem
-
- structure Vector: MONO_VECTOR
-
- val app: (elem -> unit) -> array -> unit
- val appi: ((int * elem) -> unit) -> (array * int * int option) -> unit
- val array: (int * elem) -> array
- val copy: {src: array,
- si: int,
- len: int option,
- dst: array,
- di: int} -> unit
- val copyVec: {src: Vector.vector,
- si: int,
- len: int option,
- dst: array,
- di: int} -> unit
- val extract: (array * int * int option) -> Vector.vector
- val foldl: ((elem * 'b) -> 'b) -> 'b -> array -> 'b
- val foldli:
- ((int * elem * 'b) -> 'b) -> 'b -> (array * int * int option) -> 'b
- val foldr: ((elem * 'b) -> 'b) -> 'b -> array -> 'b
- val foldri:
- ((int * elem * 'b) -> 'b) -> 'b -> (array * int * int option) -> 'b
- val fromList: elem list -> array
- val length: array -> int
+ type vector
+
val maxLen: int
+ val array: int * elem -> array
+ val fromList: elem list -> array
+ val tabulate: int * (int -> elem) -> array
+ val length: array -> int
+ val sub: array * int -> elem
+ val update: array * int * elem -> unit
+ val vector: array -> vector
+ val copy: {src: array, dst: array, di: int} -> unit
+ val copyVec: {src: vector, dst: array, di: int} -> unit
+ val appi: (int * elem -> unit) -> array -> unit
+ val app: (elem -> unit) -> array -> unit
+ val modifyi: (int * elem -> elem) -> array -> unit
val modify: (elem -> elem) -> array -> unit
- val modifyi: ((int * elem) -> elem) -> (array * int * int option) -> unit
- val sub: (array * int) -> elem
- val tabulate: (int * (int -> elem)) -> array
- val update: (array * int * elem) -> unit
+ val foldli: (int * elem * 'b -> 'b) -> 'b -> array -> 'b
+ val foldri: (int * elem * 'b -> 'b) -> 'b -> array -> 'b
+ val foldl: (elem * 'b -> 'b) -> 'b -> array -> 'b
+ val foldr: (elem * 'b -> 'b) -> 'b -> array -> 'b
+ val findi: (int * elem -> bool) -> array -> (int * elem) option
+ val find: (elem -> bool) -> array -> elem option
+ val exists: (elem -> bool) -> array -> bool
+ val all: (elem -> bool) -> array -> bool
+ val collate: (elem * elem -> order) -> array * array -> order
+
+ (* Depreciated *)
+ val extract: array * int * int option -> vector
end
1.2.2.1 +12 -7 mlton/basis-library/arrays-and-vectors/mono-array.sml
Index: mono-array.sml
===================================================================
RCS file: /cvsroot/mlton/mlton/basis-library/arrays-and-vectors/mono-array.sml,v
retrieving revision 1.2
retrieving revision 1.2.2.1
diff -u -r1.2 -r1.2.2.1
--- mono-array.sml 10 Apr 2002 07:02:15 -0000 1.2
+++ mono-array.sml 20 Jul 2002 23:59:00 -0000 1.2.2.1
@@ -7,27 +7,32 @@
*)
functor MonoArray (V: CONCRETE_MONO_VECTOR): MONO_ARRAY =
struct
- structure Vector = V
- type elem = V.elem
open Array
+ type elem = V.elem
type array = elem array
+ type vector = V.vector
end
structure Word8Array = MonoArray (Word8Vector)
+
(* Can't use MonoArray to create CharArray because Basis Library spec requires
* type CharVector.vector = string, not char vector.
*)
structure CharArray: MONO_ARRAY =
struct
- structure Vector = CharVector
- type elem = char
open Array
+ type elem = char
type array = elem array
- val extract = Primitive.String.fromCharVector o extract
- fun copyVec {src, dst, si, len, di} =
+ type vector = CharVector.vector
+ val vector = Primitive.String.fromCharVector o vector
+ fun copyVec {src, dst, di} =
Array.copyVec {src = Primitive.String.toCharVector src,
- dst = dst, si = si, len = len, di = di}
+ dst = dst, di = di}
+
+ (* Depreciated *)
+ val extract = Primitive.String.fromCharVector o extract
end
+
structure BoolArray = MonoArray (BoolVector)
structure IntArray = MonoArray (IntVector)
structure RealArray = MonoArray (RealVector)
1.2.2.1 +2 -0 mlton/basis-library/arrays-and-vectors/mono-array2.sml
Index: mono-array2.sml
===================================================================
RCS file: /cvsroot/mlton/mlton/basis-library/arrays-and-vectors/mono-array2.sml,v
retrieving revision 1.2
retrieving revision 1.2.2.1
diff -u -r1.2 -r1.2.2.1
--- mono-array2.sml 10 Apr 2002 07:02:15 -0000 1.2
+++ mono-array2.sml 20 Jul 2002 23:59:00 -0000 1.2.2.1
@@ -19,6 +19,7 @@
end
structure Word8Array2 = MonoArray2 (Word8Vector)
+(*
structure CharArray2: MONO_ARRAY2 =
struct
structure Vector = CharVector
@@ -33,6 +34,7 @@
val row = Primitive.String.fromCharVector o row
val column = Primitive.String.fromCharVector o column
end
+*)
structure BoolArray2 = MonoArray2 (BoolVector)
structure IntArray2 = MonoArray2 (IntVector)
structure RealArray2 = MonoArray2 (RealVector)
1.1.1.1.10.1 +40 -25 mlton/basis-library/arrays-and-vectors/mono-vector.sig
Index: mono-vector.sig
===================================================================
RCS file: /cvsroot/mlton/mlton/basis-library/arrays-and-vectors/mono-vector.sig,v
retrieving revision 1.1.1.1
retrieving revision 1.1.1.1.10.1
diff -u -r1.1.1.1 -r1.1.1.1.10.1
--- mono-vector.sig 18 Jul 2001 05:51:02 -0000 1.1.1.1
+++ mono-vector.sig 20 Jul 2002 23:59:00 -0000 1.1.1.1.10.1
@@ -7,18 +7,23 @@
val tabulate: int * (int -> elem) -> vector
val length: vector -> int
val sub: vector * int -> elem
- val extract: vector * int * int option -> vector
+ val update: vector * int * elem -> vector
val concat: vector list -> vector
- val mapi: (int * elem -> elem) -> vector * int * int option -> vector
- val map: (elem -> elem) -> vector -> vector
- val appi: (int * elem -> unit) -> vector * int * int option -> unit
+ val appi: (int * elem -> unit) -> vector -> unit
val app: (elem -> unit) -> vector -> unit
- val foldli:
- (int * elem * 'a -> 'a) -> 'a -> vector * int * int option -> 'a
- val foldri:
- (int * elem * 'a -> 'a) -> 'a -> vector * int * int option -> 'a
+ val mapi: (int * elem -> elem) -> vector -> vector
+ val map: (elem -> elem) -> vector -> vector
+ val foldli: (int * elem * 'a -> 'a) -> 'a -> vector -> 'a
+ val foldri: (int * elem * 'a -> 'a) -> 'a -> vector -> 'a
val foldl: (elem * 'a -> 'a) -> 'a -> vector -> 'a
val foldr: (elem * 'a -> 'a) -> 'a -> vector -> 'a
+ val findi: (int * elem -> bool) -> vector -> (int * elem) option
+ val exists: (elem -> bool) -> vector -> bool
+ val all: (elem -> bool) -> vector -> bool
+ val collate: (elem * elem -> order) -> vector * vector -> order
+
+ (* Depreciated *)
+ val extract: vector * int * int option -> vector
end
(* The only difference between CONCRETE_MONO_VECTOR and MONO_VECTOR is that
@@ -34,39 +39,49 @@
val tabulate: int * (int -> elem) -> vector
val length: vector -> int
val sub: vector * int -> elem
- val extract: vector * int * int option -> vector
+ val update: vector * int * elem -> vector
val concat: vector list -> vector
- val mapi: (int * elem -> elem) -> vector * int * int option -> vector
- val map: (elem -> elem) -> vector -> vector
- val appi: (int * elem -> unit) -> vector * int * int option -> unit
+ val appi: (int * elem -> unit) -> vector -> unit
val app: (elem -> unit) -> vector -> unit
- val foldli:
- (int * elem * 'a -> 'a) -> 'a -> vector * int * int option -> 'a
- val foldri:
- (int * elem * 'a -> 'a) -> 'a -> vector * int * int option -> 'a
+ val mapi: (int * elem -> elem) -> vector -> vector
+ val map: (elem -> elem) -> vector -> vector
+ val foldli: (int * elem * 'a -> 'a) -> 'a -> vector -> 'a
+ val foldri: (int * elem * 'a -> 'a) -> 'a -> vector -> 'a
val foldl: (elem * 'a -> 'a) -> 'a -> vector -> 'a
val foldr: (elem * 'a -> 'a) -> 'a -> vector -> 'a
+ val findi: (int * elem -> bool) -> vector -> (int * elem) option
+ val exists: (elem -> bool) -> vector -> bool
+ val all: (elem -> bool) -> vector -> bool
+ val collate: (elem * elem -> order) -> vector * vector -> order
+
+ (* Depreciated *)
+ val extract: vector * int * int option -> vector
end
signature EQTYPE_MONO_VECTOR =
sig
- type elem
+ eqtype elem
type vector = elem Vector.vector
val maxLen: int
val fromList: elem list -> vector
val tabulate: int * (int -> elem) -> vector
val length: vector -> int
val sub: vector * int -> elem
- val extract: vector * int * int option -> vector
+ val update: vector * int * elem -> vector
val concat: vector list -> vector
- val mapi: (int * elem -> elem) -> vector * int * int option -> vector
- val map: (elem -> elem) -> vector -> vector
- val appi: (int * elem -> unit) -> vector * int * int option -> unit
+ val appi: (int * elem -> unit) -> vector -> unit
val app: (elem -> unit) -> vector -> unit
- val foldli:
- (int * elem * 'a -> 'a) -> 'a -> vector * int * int option -> 'a
- val foldri:
- (int * elem * 'a -> 'a) -> 'a -> vector * int * int option -> 'a
+ val mapi: (int * elem -> elem) -> vector -> vector
+ val map: (elem -> elem) -> vector -> vector
+ val foldli: (int * elem * 'a -> 'a) -> 'a -> vector -> 'a
+ val foldri: (int * elem * 'a -> 'a) -> 'a -> vector -> 'a
val foldl: (elem * 'a -> 'a) -> 'a -> vector -> 'a
val foldr: (elem * 'a -> 'a) -> 'a -> vector -> 'a
+ val findi: (int * elem -> bool) -> vector -> (int * elem) option
+ val exists: (elem -> bool) -> vector -> bool
+ val all: (elem -> bool) -> vector -> bool
+ val collate: (elem * elem -> order) -> vector * vector -> order
+
+ (* Depreciated *)
+ val extract: vector * int * int option -> vector
end
1.2.2.1 +4 -1 mlton/basis-library/arrays-and-vectors/mono-vector.sml
Index: mono-vector.sml
===================================================================
RCS file: /cvsroot/mlton/mlton/basis-library/arrays-and-vectors/mono-vector.sml,v
retrieving revision 1.2
retrieving revision 1.2.2.1
diff -u -r1.2 -r1.2.2.1
--- mono-vector.sml 10 Apr 2002 07:02:15 -0000 1.2
+++ mono-vector.sml 20 Jul 2002 23:59:00 -0000 1.2.2.1
@@ -24,5 +24,8 @@
structure BoolVector = MonoVector(type elem = bool)
structure IntVector = MonoVector(type elem = int)
+structure Int32Vector = IntVector
structure RealVector = MonoVector(type elem = real)
-
+structure Real64Vector = RealVector
+structure WordVector = MonoVector(type elem = word)
+structure Word32Vector = WordVector
1.10.2.1 +183 -108 mlton/basis-library/arrays-and-vectors/sequence.fun
Index: sequence.fun
===================================================================
RCS file: /cvsroot/mlton/mlton/basis-library/arrays-and-vectors/sequence.fun,v
retrieving revision 1.10
retrieving revision 1.10.2.1
diff -u -r1.10 -r1.10.2.1
--- sequence.fun 10 Apr 2002 07:02:15 -0000 1.10
+++ sequence.fun 20 Jul 2002 23:59:00 -0000 1.10.2.1
@@ -9,7 +9,7 @@
type 'a sequence
type 'a elt
(* fromArray should be constant time. *)
- val fromArray: 'a elt array -> 'a sequence
+ val fromArray: 'a elt Array.array -> 'a sequence
val isMutable: bool
val length: 'a sequence -> int
val sub: 'a sequence * int -> 'a elt
@@ -29,16 +29,6 @@
then Array.array0Const ()
else Array.array n
- fun sub (s, i) =
- if Primitive.safe andalso Primitive.Int.geu (i, length s)
- then raise Subscript
- else S.sub (s, i)
-
- fun update (a, i, x) =
- if Primitive.safe andalso Primitive.Int.geu (i, Array.length a)
- then raise Subscript
- else Array.update (a, i, x)
-
fun unfoldi (n, b, f) =
let
val a = array n
@@ -102,10 +92,186 @@
fun fromList l = fromListOfLength (l, List.length l)
- type 'a slice = 'a sequence * int * int option
-
- fun 'a wholeSlice (a: 'a sequence): 'a slice = (a, 0, NONE)
+ structure Slice =
+ struct
+ type 'a sequence = 'a sequence
+ type 'a elt = 'a elt
+ type 'a slice = {seq: 'a sequence, start: int, len: int}
+
+ fun base (sl: 'a slice as {seq, start, len}) = (seq, start, len)
+ fun length (sl: 'a slice) = #len sl
+ fun sub (sl: 'a slice as {seq, start, len}, i) =
+ if Primitive.safe andalso Primitive.Int.geu (i, len)
+ then raise Subscript
+ else S.sub (seq, start +? i)
+ fun unsafeSub (sl: 'a slice as {seq, start, ...}, i) =
+ S.sub (seq, start +? i)
+ fun update' update (sl: 'a slice as {seq, start, len}, i, x) =
+ if Primitive.safe andalso Primitive.Int.geu (i, len)
+ then raise Subscript
+ else update (seq, start +? i, x)
+ fun unsafeUpdate' update (sl: 'a slice as {seq, start, ...}, i, x) =
+ update (seq, start +? i, x)
+ fun full (seq: 'a sequence) : 'a slice =
+ {seq = seq, start = 0, len = S.length seq}
+ fun subslice (sl: 'a slice as {seq, start, len},
+ start': int,
+ len': int option) =
+ case len' of
+ NONE => if Primitive.safe andalso
+ (start' < 0 orelse start' > len)
+ then raise Subscript
+ else {seq = seq,
+ start = start +? start',
+ len = len -? start'}
+ | SOME len' => if Primitive.safe andalso
+ (start' < 0 orelse start' > len orelse
+ len' < 0 orelse len' > len -? start')
+ then raise Subscript
+ else {seq = seq,
+ start = start +? start',
+ len = len'}
+ fun slice (seq: 'a sequence, start: int, len: int option) =
+ subslice (full seq, start, len)
+ fun isEmpty sl = length sl = 0
+ fun getItem (sl: 'a slice as {seq, start, len}) =
+ if isEmpty sl
+ then NONE
+ else SOME (S.sub (seq, start),
+ {seq = seq,
+ start = start +? 1,
+ len = len -? 1})
+ fun foldli f b (sl: 'a slice as {seq, start, len}) =
+ let
+ val min = start
+ val max = start +? len
+ fun loop (i, b) =
+ if i >= max then b
+ else loop (i +? 1, f (i -? min, S.sub (seq, i), b))
+ in loop (min, b)
+ end
+ fun foldri f b (sl: 'a slice as {seq, start, len}) =
+ let
+ val min = start
+ val max = start +? len
+ fun loop (i, b) =
+ if i <= min then b
+ else loop (i -? 1, f (i -? min, S.sub (seq, i), b))
+ in loop (max, b)
+ end
+ local
+ fun make foldi f b sl = foldi (fn (_, x, b) => f (x, b)) b sl
+ in
+ fun foldl f = make foldli f
+ fun foldr f = make foldri f
+ end
+ fun appi f sl = foldli (fn (i, x, ()) => f (i, x)) () sl
+ fun app f sl = appi (f o #2) sl
+ fun mapi' tabulate f (sl: 'a slice as {seq, start, len}) =
+ tabulate (len, fn i => let val j = start +? i
+ in f (j, S.sub (seq, j))
+ end)
+ fun map' tabulate f sl = mapi' tabulate (f o #2) sl
+ fun mapi f sl = mapi' tabulate f sl
+ fun map f sl = mapi (f o #2) sl
+ fun findi p (sl: 'a slice as {seq, start, len}) =
+ let
+ val min = start
+ val max = start +? len
+ fun loop i =
+ if i >= max
+ then NONE
+ else let val z = (i -? min, S.sub (seq, i))
+ in if p z
+ then SOME z
+ else loop (i +? 1)
+ end
+ in loop min
+ end
+ fun find p sl = Option.map #2 (findi (p o #2) sl)
+ fun existsi p sl = Option.isSome (findi p sl)
+ fun exists p sl = existsi (p o #2) sl
+ fun alli p sl = not (existsi (not o p) sl)
+ fun all p sl = alli (p o #2) sl
+ fun collate cmp (sl1 as {seq = seq1, start = start1, len = len1},
+ sl2 as {seq = seq2, start = start2, len = len2}) =
+ let
+ val min1 = start1
+ val min2 = start2
+ val max1 = start1 +? len1
+ val max2 = start2 +? len2
+ fun loop (i, j) =
+ case (i >= max1, j >= max2) of
+ (true, true) => EQUAL
+ | (true, false) => LESS
+ | (false, true) => GREATER
+ | (false, false) =>
+ (case cmp (S.sub (seq1, i), S.sub (seq2, j)) of
+ EQUAL => loop (i +? 1, j +? 1)
+ | ans => ans)
+ in loop (min1, min2)
+ end
+ fun toList (sl: 'a slice) = foldr (fn (a,l) => a::l) [] sl
+ fun copy sl = map (fn x => x) sl
+ fun concat (sls: 'a slice list): 'a sequence =
+ case sls of
+ [] => fromArray (array 0)
+ | [sl as {seq, start, len}] =>
+ if isMutable orelse (start <> 0 orelse len <> S.length seq)
+ then copy sl
+ else seq
+ | sl::sls' =>
+ let
+ val n = List.foldl (fn (sl, s) => s + length sl) 0 sls
+ handle Overflow => raise Size
+ in
+ unfoldi (n, (0, sl, sls'),
+ fn (_, ac) =>
+ let
+ fun loop (i, sl, sls) =
+ if i < length sl
+ then (unsafeSub (sl, i), (i +? 1, sl, sls))
+ else case sls of
+ [] => raise Fail "concat bug"
+ | sl :: sls => loop (0, sl, sls)
+ in loop ac
+ end)
+ end
+ end
+ local
+ fun make f seq = f (Slice.full seq)
+ fun make2 f (seq1, seq2) = f (Slice.full seq1, Slice.full seq2)
+ in
+ fun sub (seq, i) = Slice.sub (Slice.full seq, i)
+ fun unsafeSub (seq, i) = Slice.unsafeSub (Slice.full seq, i)
+ fun update' update (seq, i, x) =
+ Slice.update' update (Slice.full seq, i, x)
+ fun unsafeUpdate' update (seq, i, x) =
+ Slice.unsafeUpdate' update (Slice.full seq, i, x)
+ fun foldli f b = make (Slice.foldli f b)
+ fun foldri f b = make (Slice.foldri f b)
+ fun foldl f b = make (Slice.foldl f b)
+ fun foldr f b = make (Slice.foldr f b)
+ fun appi f = make (Slice.appi f)
+ fun app f = make (Slice.app f)
+ fun mapi' tabulate f = make (Slice.mapi' tabulate f)
+ fun map' tabulate f = make (Slice.map' tabulate f)
+ fun mapi f = make (Slice.mapi f)
+ fun map f = make (Slice.map f)
+ fun copy seq = make (Slice.copy) seq
+ fun findi p = make (Slice.findi p)
+ fun find p = make (Slice.find p)
+ fun existsi p = make (Slice.existsi p)
+ fun exists p = make (Slice.exists p)
+ fun alli p = make (Slice.alli p)
+ fun all p = make (Slice.all p)
+ fun collate cmp = make2 (Slice.collate cmp)
+ fun toList seq = make (Slice.toList) seq
+ fun concat seqs = Slice.concat (List.map Slice.full seqs)
+ end
+
+ (* Depreciated *)
fun checkSliceMax (start: int, num: int option, max: int): int =
case num of
NONE => if Primitive.safe andalso (start < 0 orelse start > max)
@@ -116,99 +282,8 @@
andalso (start < 0 orelse num < 0 orelse start > max -? num)
then raise Subscript
else start +? num
-
+ (* Depreciated *)
fun checkSlice (s, i, opt) = checkSliceMax (i, opt, length s)
-
- fun foldli f b (slice as (s, min, _)) =
- let
- val max = checkSlice slice
- fun loop (i, b) =
- if i >= max then b
- else loop (i + 1, f (i, S.sub (s, i), b))
- in loop (min, b)
- end
-
- fun appi f slice = foldli (fn (i, x, ()) => f (i, x)) () slice
-
- fun app f s = appi (f o #2) (wholeSlice s)
-
- fun foldri f b (slice as (s, min, _)) =
- let
- val max = checkSlice slice
- fun loop (i, b) =
- if i < min
- then b
- else loop (i -? 1, f (i, S.sub (s, i), b))
- in loop (max -? 1, b)
- end
-
- local
- fun make foldi f b s = foldi (fn (_, x, b) => f (x, b)) b (wholeSlice s)
- in
- fun foldl f = make foldli f
- fun foldr f = make foldri f
- end
-
- fun mapi f (slice as (s, min, _)) =
- let val max = checkSlice slice
- in tabulate (max -? min, fn i => let val j = i +? min
- in f (j, S.sub (s, j))
- end)
- end
-
- fun map f s = mapi (f o #2) (wholeSlice s)
-
- val extract =
- fn (s, 0, NONE) => s
- | slice => mapi #2 slice
-
- fun copy s = map (fn x => x) s
-
- fun 'a concat (vs: 'a sequence list): 'a sequence =
- case vs of
- [] => fromArray (array 0)
- | [v] => if isMutable then copy v else v
- | v :: vs' =>
- let
- val n = List.foldl (fn (v, s) => s + length v) 0 vs
- in
- unfoldi (n, (0, v, vs'),
- fn (_, ac) =>
- let
- fun loop (i, v, vs) =
- if i < length v
- then (sub (v, i), (i + 1, v, vs))
- else
- case vs of
- [] => raise Fail "concat bug"
- | v :: vs => loop (0, v, vs)
- in loop ac
- end)
- end
-
- fun prefixToList (s, n) =
- let
- fun loop (i, l) =
- if i < 0
- then l
- else loop (i - 1, S.sub (s, i) :: l)
- in loop (n - 1, [])
- end
-
- fun toList a = prefixToList (a, length a)
-
- fun find (s, p) =
- let
- val max = length s
- fun loop i =
- if i >= max
- then NONE
- else let
- val x = S.sub (s, i)
- in if p x
- then SOME x
- else loop (i + 1)
- end
- in loop 0
- end
+ (* Depreciatd *)
+ fun extract args = Slice.copy (Slice.slice args)
end
1.4.2.1 +94 -24 mlton/basis-library/arrays-and-vectors/sequence.sig
Index: sequence.sig
===================================================================
RCS file: /cvsroot/mlton/mlton/basis-library/arrays-and-vectors/sequence.sig,v
retrieving revision 1.4
retrieving revision 1.4.2.1
diff -u -r1.4 -r1.4.2.1
--- sequence.sig 10 Apr 2002 07:02:15 -0000 1.4
+++ sequence.sig 20 Jul 2002 23:59:00 -0000 1.4.2.1
@@ -5,40 +5,110 @@
* MLton is released under the GNU General Public License (GPL).
* Please see the file MLton-LICENSE for license information.
*)
+
+signature SLICE =
+ sig
+ type 'a sequence
+ type 'a elt
+ type 'a slice
+ val length: 'a slice -> int
+ val sub: 'a slice * int -> 'a elt
+ val unsafeSub: 'a slice * int -> 'a elt
+ (* ('a sequence * int * 'a elt -> unit should be an unsafe update.
+ *)
+ val update': ('a sequence * int * 'a elt -> unit) ->
+ ('a slice * int * 'a elt) -> unit
+ val unsafeUpdate': ('a sequence * int * 'a elt -> unit) ->
+ ('a slice * int * 'a elt) -> unit
+ val full: 'a sequence -> 'a slice
+ val slice: 'a sequence * int * int option -> 'a slice
+ val subslice: 'a slice * int * int option -> 'a slice
+ val base: 'a slice -> 'a sequence * int * int
+ val concat: 'a slice list -> 'a sequence
+ val isEmpty: 'a slice -> bool
+ val getItem: 'a slice -> ('a elt * 'a slice) option
+ val appi: (int * 'a elt -> unit) -> 'a slice -> unit
+ val app: ('a elt -> unit) -> 'a slice -> unit
+ (* (int * (int -> 'b elt) -> 'c should be a tabulate function;
+ * hence, 'c is really 'b sequence' for some sequence'.
+ *)
+ val mapi': (int * (int -> 'b elt) -> 'c) ->
+ (int * 'a elt -> 'b elt) -> 'a slice -> 'c
+ val map': (int * (int -> 'b elt) -> 'c) ->
+ ('a elt -> 'b elt) -> 'a slice -> 'c
+ val mapi: (int * 'a elt -> 'b elt) -> 'a slice -> 'b sequence
+ val map: ('a elt -> 'b elt) -> 'a slice -> 'b sequence
+ val foldli: (int * 'a elt * 'b -> 'b) -> 'b -> 'a slice -> 'b
+ val foldri: (int * 'a elt * 'b -> 'b) -> 'b -> 'a slice -> 'b
+ val foldl: ('a elt * 'b -> 'b) -> 'b -> 'a slice -> 'b
+ val foldr: ('a elt * 'b -> 'b) -> 'b -> 'a slice -> 'b
+ val findi: (int * 'a elt -> bool) -> 'a slice -> (int * 'a elt) option
+ val find: ('a elt -> bool) -> 'a slice -> 'a elt option
+ val existsi: (int * 'a elt -> bool) -> 'a slice -> bool
+ val exists: ('a elt -> bool) -> 'a slice -> bool
+ val alli: (int * 'a elt -> bool) -> 'a slice -> bool
+ val all: ('a elt -> bool) -> 'a slice -> bool
+ val collate: ('a elt * 'a elt -> order) -> 'a slice * 'a slice -> order
+
+ (* Extra *)
+ val copy: 'a slice -> 'a sequence
+ val toList: 'a slice -> 'a elt list
+ end
+
signature SEQUENCE =
sig
type 'a sequence
type 'a elt
+ structure Slice : SLICE where type 'a sequence = 'a sequence
+ and type 'a elt = 'a elt
+
+ val maxLen: int
+ val fromList: 'a elt list -> 'a sequence
+ val tabulate: int * (int -> 'a elt) -> 'a sequence
+ val length: 'a sequence -> int
+ val sub: 'a sequence * int -> 'a elt
+ val unsafeSub: 'a sequence * int -> 'a elt
+ (* ('a sequence * int * 'a elt -> unit should be an unsafe update.
+ *)
+ val update': ('a sequence * int * 'a elt -> unit) ->
+ ('a sequence * int * 'a elt) -> unit
+ val unsafeUpdate': ('a sequence * int * 'a elt -> unit) ->
+ ('a sequence * int * 'a elt) -> unit
+ val concat: 'a sequence list -> 'a sequence
+ val appi: (int * 'a elt -> unit) -> 'a sequence -> unit
val app: ('a elt -> unit) -> 'a sequence -> unit
- val appi: (int * 'a elt -> unit) -> 'a sequence * int * int option -> unit
- (* checkSlice returns max where the slice is from min (inclusive)
- * to max (exclusive). Raises Subscript if invalid slice.
+ (* (int * (int -> 'b elt) -> 'c should be a tabulate function;
+ * hence, 'c is really 'b sequence' for some sequence'.
*)
- val checkSlice: 'a sequence * int * int option -> int
- val checkSliceMax: int * int option * int -> int
- val concat: 'a sequence list -> 'a sequence
- val extract: 'a sequence * int * int option -> 'a sequence
- val find: 'a sequence * ('a elt -> bool) -> 'a elt option
+ val mapi': (int * (int -> 'b elt) -> 'c) ->
+ (int * 'a elt -> 'b elt) -> 'a sequence -> 'c
+ val map': (int * (int -> 'b elt) -> 'c) ->
+ ('a elt -> 'b elt) -> 'a sequence -> 'c
+ val mapi : (int * 'a elt -> 'b elt) -> 'a sequence -> 'b sequence
+ val map: ('a elt -> 'b elt) -> 'a sequence -> 'b sequence
+ val foldli: (int * 'a elt * 'b -> 'b) -> 'b -> 'a sequence -> 'b
+ val foldri: (int * 'a elt * 'b -> 'b) -> 'b -> 'a sequence -> 'b
val foldl: ('a elt * 'b -> 'b) -> 'b -> 'a sequence -> 'b
- val foldli:
- (int * 'a elt * 'b -> 'b) -> 'b -> 'a sequence * int * int option -> 'b
val foldr: ('a elt * 'b -> 'b) -> 'b -> 'a sequence -> 'b
- val foldri:
- (int * 'a elt * 'b -> 'b) -> 'b -> 'a sequence * int * int option -> 'b
- val fromList: 'a elt list -> 'a sequence
- val length: 'a sequence -> int
- val map: ('a elt -> 'b elt) -> 'a sequence -> 'b sequence
- val mapi:
- (int * 'a elt -> 'b elt)
- -> 'a sequence * int * int option -> 'b sequence
- val maxLen: int
+ val findi: (int * 'a elt -> bool) -> 'a sequence -> (int * 'a elt) option
+ val find: ('a elt -> bool) -> 'a sequence -> 'a elt option
+ val existsi: (int * 'a elt -> bool) -> 'a sequence -> bool
+ val exists: ('a elt -> bool) -> 'a sequence -> bool
+ val alli: (int * 'a elt -> bool) -> 'a sequence -> bool
+ val all: ('a elt -> bool) -> 'a sequence -> bool
+ val collate: ('a elt * 'a elt -> order) -> 'a sequence * 'a sequence -> order
+
+ (* Extra *)
+ val copy: 'a sequence -> 'a sequence
val new: int * 'a elt -> 'a sequence
- val prefixToList: 'a sequence * int -> 'a elt list
- val sub: 'a sequence * int -> 'a elt
- val tabulate: int * (int -> 'a elt) -> 'a sequence
val toList: 'a sequence -> 'a elt list
val unfoldi: int * 'a * (int * 'a -> 'b elt * 'a) -> 'b sequence
- val update: 'a elt array * int * 'a elt -> unit
- val wholeSlice: 'a sequence -> 'a sequence * int * int option
+
+ (* Depreciated *)
+ val checkSlice: 'a sequence * int * int option -> int
+ (* Depreciated *)
+ val checkSliceMax: int * int option * int -> int
+ (* Depreciated *)
+ val extract: 'a sequence * int * int option -> 'a sequence
end
1.3.10.1 +19 -9 mlton/basis-library/arrays-and-vectors/vector.sig
Index: vector.sig
===================================================================
RCS file: /cvsroot/mlton/mlton/basis-library/arrays-and-vectors/vector.sig,v
retrieving revision 1.3
retrieving revision 1.3.10.1
diff -u -r1.3 -r1.3.10.1
--- vector.sig 1 Aug 2001 20:04:01 -0000 1.3
+++ vector.sig 20 Jul 2002 23:59:00 -0000 1.3.10.1
@@ -12,26 +12,36 @@
val tabulate: int * (int -> 'a) -> 'a vector
val length: 'a vector -> int
val sub: 'a vector * int -> 'a
- val extract: 'a vector * int * int option -> 'a vector
+ val update: 'a vector * int * 'a -> 'a vector
val concat: 'a vector list -> 'a vector
- val mapi : (int * 'a -> 'b) -> 'a vector * int * int option -> 'b vector
- val map: ('a -> 'b) -> 'a vector -> 'b vector
- val appi: (int * 'a -> unit) -> 'a vector * int * int option -> unit
+ val appi: (int * 'a -> unit) -> 'a vector -> unit
val app: ('a -> unit) -> 'a vector -> unit
- val foldli :
- (int * 'a * 'b -> 'b) -> 'b -> 'a vector * int * int option -> 'b
- val foldri :
- (int * 'a * 'b -> 'b) -> 'b -> 'a vector * int * int option -> 'b
+ val mapi : (int * 'a -> 'b) -> 'a vector -> 'b vector
+ val map: ('a -> 'b) -> 'a vector -> 'b vector
+ val foldli: (int * 'a * 'b -> 'b) -> 'b -> 'a vector -> 'b
+ val foldri: (int * 'a * 'b -> 'b) -> 'b -> 'a vector -> 'b
val foldl: ('a * 'b -> 'b) -> 'b -> 'a vector -> 'b
val foldr: ('a * 'b -> 'b) -> 'b -> 'a vector -> 'b
+ val findi: (int * 'a -> bool) -> 'a vector -> (int * 'a) option
+ val find: ('a -> bool) -> 'a vector -> 'a option
+ val exists: ('a -> bool) -> 'a vector -> bool
+ val all: ('a -> bool) -> 'a vector -> bool
+ val collate: ('a * 'a -> order) -> 'a vector * 'a vector -> order
end
signature VECTOR_EXTRA =
sig
include VECTOR
+ structure VectorSlice: VECTOR_SLICE_EXTRA where type 'a vector = 'a vector
- val checkSlice: 'a vector * int * int option -> int
+ val vector: int * 'a -> 'a vector
val fromArray: 'a array -> 'a vector
+ val toList: 'a vector -> 'a list
val unfoldi: int * 'a * (int * 'a -> 'b * 'a) -> 'b vector
val unsafeSub: 'a vector * int -> 'a
+
+ (* Depreciated *)
+ val checkSlice: 'a vector * int * int option -> int
+ (* Depreciated *)
+ val extract: 'a vector * int * int option -> 'a vector
end
1.3.2.1 +17 -1 mlton/basis-library/arrays-and-vectors/vector.sml
Index: vector.sml
===================================================================
RCS file: /cvsroot/mlton/mlton/basis-library/arrays-and-vectors/vector.sml,v
retrieving revision 1.3
retrieving revision 1.3.2.1
diff -u -r1.3 -r1.3.2.1
--- vector.sml 10 Apr 2002 07:02:15 -0000 1.3
+++ vector.sml 20 Jul 2002 23:59:00 -0000 1.3.2.1
@@ -11,14 +11,30 @@
type 'a elt = 'a
val fromArray = Primitive.Vector.fromArray
val isMutable = false
- open Primitive.Vector)
+ val length = Primitive.Vector.length
+ val sub = Primitive.Vector.sub)
open V
type 'a vector = 'a vector
+ val vector = new
+
+ structure VectorSlice =
+ struct
+ open Slice
+ type 'a vector = 'a vector
+ fun vector sl = copy sl
+ end
+
+ fun update (v, i, x) =
+ tabulate (length v,
+ fn j => if i = j
+ then x
+ else unsafeSub (v, j))
val fromArray = Primitive.Vector.fromArray
val unsafeSub = Primitive.Vector.sub
end
+structure VectorSlice: VECTOR_SLICE_EXTRA = Vector.VectorSlice
structure VectorGlobal: VECTOR_GLOBAL = Vector
open VectorGlobal
No revision
No revision
1.1.2.1 +49 -0 mlton/basis-library/arrays-and-vectors/Attic/array-slice.sig
1.1.2.1 +43 -0 mlton/basis-library/arrays-and-vectors/Attic/vector-slice.sig
No revision
No revision
1.3.2.1 +1 -1 mlton/basis-library/general/bool.sig
Index: bool.sig
===================================================================
RCS file: /cvsroot/mlton/mlton/basis-library/general/bool.sig,v
retrieving revision 1.3
retrieving revision 1.3.2.1
diff -u -r1.3 -r1.3.2.1
--- bool.sig 20 Jul 2002 23:14:01 -0000 1.3
+++ bool.sig 20 Jul 2002 23:59:00 -0000 1.3.2.1
@@ -9,7 +9,7 @@
sig
include BOOL_GLOBAL
- val toString: bool -> string
val fromString: string -> bool option
val scan: (char, 'a) StringCvt.reader -> (bool, 'a) StringCvt.reader
+ val toString: bool -> string
end
1.4.2.1 +4 -4 mlton/basis-library/general/bool.sml
Index: bool.sml
===================================================================
RCS file: /cvsroot/mlton/mlton/basis-library/general/bool.sml,v
retrieving revision 1.4
retrieving revision 1.4.2.1
diff -u -r1.4 -r1.4.2.1
--- bool.sml 20 Jul 2002 23:14:01 -0000 1.4
+++ bool.sml 20 Jul 2002 23:59:00 -0000 1.4.2.1
@@ -11,10 +11,6 @@
val not = not
- val toString =
- fn true => "true"
- | false => "false"
-
fun scan reader state =
case reader state of
NONE => NONE
@@ -31,6 +27,10 @@
| _ => NONE
val fromString = StringCvt.scanString scan
+
+ val toString =
+ fn true => "true"
+ | false => "false"
end
structure BoolGlobal: BOOL_GLOBAL = Bool
1.3.2.1 +3 -1 mlton/basis-library/general/general.sig
Index: general.sig
===================================================================
RCS file: /cvsroot/mlton/mlton/basis-library/general/general.sig,v
retrieving revision 1.3
retrieving revision 1.3.2.1
diff -u -r1.3 -r1.3.2.1
--- general.sig 20 Jul 2002 23:14:01 -0000 1.3
+++ general.sig 20 Jul 2002 23:59:00 -0000 1.3.2.1
@@ -4,18 +4,20 @@
type exn
exception Bind
+ exception Match
exception Chr
exception Div
exception Domain
exception Fail of string
- exception Match
exception Overflow
exception Size
exception Span
exception Subscript
val exnName: exn -> string
val exnMessage: exn -> string
+
datatype order = LESS | EQUAL | GREATER
+
val ! : 'a ref -> 'a
val := : ('a ref * 'a) -> unit
val o : (('b -> 'c) * ('a -> 'b)) -> 'a -> 'c
1.5.2.1 +6 -7 mlton/basis-library/general/general.sml
Index: general.sml
===================================================================
RCS file: /cvsroot/mlton/mlton/basis-library/general/general.sml,v
retrieving revision 1.5
retrieving revision 1.5.2.1
diff -u -r1.5 -r1.5.2.1
--- general.sml 20 Jul 2002 23:14:01 -0000 1.5
+++ general.sml 20 Jul 2002 23:59:00 -0000 1.5.2.1
@@ -8,29 +8,28 @@
structure General: GENERAL =
struct
type unit = unit
+
type exn = exn
-
exception Bind = Bind
+ exception Match = Match
exception Chr
exception Div
exception Domain
exception Fail = Fail
- exception Match = Match
exception Overflow = Overflow
exception Size = Size
exception Span
exception Subscript
-
- datatype order = LESS | EQUAL | GREATER
-
val exnName = Primitive.Exn.name
val exnMessage = exnName
+ datatype order = LESS | EQUAL | GREATER
+
+ val ! = Primitive.Ref.deref
+ val op := = Primitive.Ref.assign
fun (f o g) x = f (g x)
fun x before () = x
fun ignore _ = ()
- val op := = Primitive.Ref.assign
- val ! = Primitive.Ref.deref
end
structure GeneralGlobal: GENERAL_GLOBAL = General
1.3.2.1 +1 -0 mlton/basis-library/general/option.sig
Index: option.sig
===================================================================
RCS file: /cvsroot/mlton/mlton/basis-library/general/option.sig,v
retrieving revision 1.3
retrieving revision 1.3.2.1
diff -u -r1.3 -r1.3.2.1
--- option.sig 20 Jul 2002 23:14:01 -0000 1.3
+++ option.sig 20 Jul 2002 23:59:00 -0000 1.3.2.1
@@ -13,6 +13,7 @@
val filter: ('a -> bool) -> 'a -> 'a option
val join: 'a option option -> 'a option
+ val app: ('a -> unit) -> 'a option -> unit
val map: ('a -> 'b) -> 'a option -> 'b option
val mapPartial: ('a -> 'b option) -> 'a option -> 'b option
val compose: ('a -> 'b) * ('c -> 'a option) -> 'c -> 'b option
1.3.2.1 +5 -0 mlton/basis-library/general/option.sml
Index: option.sml
===================================================================
RCS file: /cvsroot/mlton/mlton/basis-library/general/option.sml,v
retrieving revision 1.3
retrieving revision 1.3.2.1
diff -u -r1.3 -r1.3.2.1
--- option.sml 20 Jul 2002 23:14:01 -0000 1.3
+++ option.sml 20 Jul 2002 23:59:00 -0000 1.3.2.1
@@ -1,4 +1,5 @@
(* Modified from SML/NJ sources by sweeks@research.nj.nec.com on 4/18/98. *)
+(* Modified by fluet@cs.cornell.edu on 7/19/02. *)
(* option.sml
*
@@ -28,6 +29,10 @@
val join =
fn SOME opt => opt
| NONE => NONE
+
+ fun app f =
+ fn SOME x => f x
+ | NONE => ()
fun map f =
fn SOME x => SOME(f x)
No revision
No revision
1.6.2.1 +9 -42 mlton/basis-library/integer/int-inf.sig
Index: int-inf.sig
===================================================================
RCS file: /cvsroot/mlton/mlton/basis-library/integer/int-inf.sig,v
retrieving revision 1.6
retrieving revision 1.6.2.1
diff -u -r1.6 -r1.6.2.1
--- int-inf.sig 20 Jul 2002 23:14:01 -0000 1.6
+++ int-inf.sig 20 Jul 2002 23:59:00 -0000 1.6.2.1
@@ -1,50 +1,17 @@
signature INT_INF =
sig
- eqtype int
+ include INTEGER
- val * : int * int -> int
- val + : int * int -> int
- val - : int * int -> int
- val < : int * int -> bool
- val <= : int * int -> bool
- val > : int * int -> bool
- val >= : int * int -> bool
- val abs: int -> int
- val compare: int * int -> order
- val div: int * int -> int
val divMod: int * int -> int * int
- val fmt: StringCvt.radix -> int -> string
- val fromInt: Int.int -> int
- val fromLarge: LargeInt.int -> int
- val fromString: string -> int option
- val log2: int -> Int.int
- val max: int * int -> int
- val maxInt: int option
- val min: int * int -> int
- val minInt: int option
- val mod: int * int -> int
- val pow: int * Int.int -> int
- val precision: Int.int option
- val quot: int * int -> int
val quotRem: int * int -> int * int
- val rem: int * int -> int
- val sameSign: int * int -> bool
- val scan:
- StringCvt.radix
- -> (char, 'a) StringCvt.reader
- -> (int, 'a) StringCvt.reader
- val sign: int -> Int.int
- val toInt: int -> Int.int
- val toLarge: int -> LargeInt.int
- val toString: int -> string
- val ~ : int -> int
-(* val orb: int * int -> int
- * val xorb: int * int -> int
- * val andb: int * int -> int
- * val notb: int -> int
- * val << : int * Word.word -> int
- * val ~>> : int * Word.word -> int
- *)
+ val pow: int * Int.int -> int
+ val log2: int -> Int.int
+(* val orb: int * int -> int *)
+(* val xorb: int * int -> int *)
+(* val andb: int * int -> int *)
+(* val notb: int -> int *)
+(* val <<: int * Word.word -> int *)
+(* val ~>>: int * Word.word -> int *)
end
signature INT_INF_EXTRA =
1.3.2.1 +28 -23 mlton/basis-library/integer/integer.sig
Index: integer.sig
===================================================================
RCS file: /cvsroot/mlton/mlton/basis-library/integer/integer.sig,v
retrieving revision 1.3
retrieving revision 1.3.2.1
diff -u -r1.3 -r1.3.2.1
--- integer.sig 20 Jul 2002 23:14:01 -0000 1.3
+++ integer.sig 20 Jul 2002 23:59:00 -0000 1.3.2.1
@@ -17,37 +17,37 @@
sig
include INTEGER_GLOBAL
- val * : int * int -> int
+ val toLarge: int -> LargeInt.int
+ val fromLarge: LargeInt.int -> int
+ val toInt: int -> Int.int
+ val fromInt: Int.int -> int
+ val precision: Int.int option
+ val minInt: int option
+ val maxInt: int option
val + : int * int -> int
val - : int * int -> int
- val < : int * int -> bool
- val <= : int * int -> bool
- val > : int * int -> bool
- val >= : int * int -> bool
- val abs: int -> int
- val compare: int * int -> order
+ val * : int * int -> int
val div: int * int -> int
- val fmt: StringCvt.radix -> int -> string
- val fromInt: Int.int -> int
- val fromLarge: LargeInt.int -> int
- val fromString: string -> int option
- val max: int * int -> int
- val maxInt: int option
- val min: int * int -> int
- val minInt: int option
val mod: int * int -> int
- val precision: Int.int option
val quot: int * int -> int
val rem: int * int -> int
- val sameSign: int * int -> bool
- val scan: StringCvt.radix
- -> (char, 'a) StringCvt.reader
- -> (int, 'a) StringCvt.reader
+ val compare: int * int -> order
+ val > : int * int -> bool
+ val >= : int * int -> bool
+ val < : int * int -> bool
+ val <= : int * int -> bool
+ val ~ : int -> int
+ val abs: int -> int
+ val min: int * int -> int
+ val max: int * int -> int
val sign: int -> Int.int
- val toInt: int -> Int.int
- val toLarge: int -> LargeInt.int
+ val sameSign: int * int -> bool
+ val fmt: StringCvt.radix -> int -> string
val toString: int -> string
- val ~ : int -> int
+ val scan: StringCvt.radix
+ -> (char, 'a) StringCvt.reader
+ -> (int, 'a) StringCvt.reader
+ val fromString: string -> int option
end
signature INTEGER_EXTRA =
@@ -59,4 +59,9 @@
val maxInt': int
val minInt': int
val power: {base: int, exp: int} -> int
+ end
+
+signature INTEGER32_EXTRA =
+ sig
+ include INTEGER_EXTRA
end
1.4.2.1 +1 -1 mlton/basis-library/integer/pack32.sml
Index: pack32.sml
===================================================================
RCS file: /cvsroot/mlton/mlton/basis-library/integer/pack32.sml,v
retrieving revision 1.4
retrieving revision 1.4.2.1
diff -u -r1.4 -r1.4.2.1
--- pack32.sml 20 Jul 2002 23:14:01 -0000 1.4
+++ pack32.sml 20 Jul 2002 23:59:00 -0000 1.4.2.1
@@ -76,7 +76,7 @@
*)
(* Depends on being on a little-endian machine. *)
-structure Pack32Little: PACK_WORD =
+structure Pack32Little: PACK_WORD_EXTRA =
struct
val start = Pack32Big.start
val _ = if Primitive.isLittleEndian
1.3.2.1 +32 -30 mlton/basis-library/integer/word.sig
Index: word.sig
===================================================================
RCS file: /cvsroot/mlton/mlton/basis-library/integer/word.sig,v
retrieving revision 1.3
retrieving revision 1.3.2.1
diff -u -r1.3 -r1.3.2.1
--- word.sig 20 Jul 2002 23:14:01 -0000 1.3
+++ word.sig 20 Jul 2002 23:59:00 -0000 1.3.2.1
@@ -1,10 +1,12 @@
-structure Word32 =
+structure Word =
struct
type word = word
end
-structure Word = Word32
-structure LargeWord = Word32
+structure LargeWord =
+ struct
+ type word = word
+ end
signature WORD_GLOBAL =
sig
@@ -15,48 +17,48 @@
sig
include WORD_GLOBAL
- val * : word * word -> word
+ val wordSize: int
+ val toLargeWord: word -> LargeWord.word
+ val toLargeWordX: word -> LargeWord.word
+ val fromLargeWord: LargeWord.word -> word
+ val toInt: word -> Int.int
+ val toIntX: word -> Int.int
+ val fromInt: Int.int -> word
+ val orb: word * word -> word
+ val xorb: word * word -> word
+ val andb: word * word -> word
+ val notb: word -> word
+ val << : word * Word.word -> word
+ val >> : word * Word.word -> word
+ val ~>> : word * Word.word -> word
val + : word * word -> word
val - : word * word -> word
+ val * : word * word -> word
+ val div: word * word -> word
+ val mod: word * word -> word
+ val ~ : word -> word
+ val compare: word * word -> order
val < : word * word -> bool
- val << : word * Word.word -> word
- val <= : word * word -> bool
val > : word * word -> bool
val >= : word * word -> bool
- val >> : word * Word.word -> word
- val andb: word * word -> word
- val compare: word * word -> order
- val div: word * word -> word
- val fromInt: Int.int -> word
- val fromLargeWord: LargeWord.word -> word
- val max: word * word -> word
+ val <= : word * word -> bool
val min: word * word -> word
- val mod: word * word -> word
- val notb: word -> word
- val orb: word * word -> word
- val toInt: word -> Int.int
- val toIntX: word -> Int.int
- val toLargeWord: word -> LargeWord.word
- val toLargeWordX: word -> LargeWord.word
- val wordSize: int
- val xorb: word * word -> word
- val ~>> : word * Word.word -> word
+ val max: word * word -> word
end
signature WORD =
sig
include PRE_WORD
- val fmt: StringCvt.radix -> word -> string
- val fromLargeInt: LargeInt.int -> word
- val fromString: string -> word option
- val scan:
- StringCvt.radix
- -> (char, 'a) StringCvt.reader
- -> (word, 'a) StringCvt.reader
val toLargeInt: word -> LargeInt.int
val toLargeIntX: word -> LargeInt.int
+ val fromLargeInt: LargeInt.int -> word
+ val fmt: StringCvt.radix -> word -> string
val toString: word -> string
+ val scan: StringCvt.radix
+ -> (char, 'a) StringCvt.reader
+ -> (word, 'a) StringCvt.reader
+ val fromString: string -> word option
end
signature WORD_EXTRA =
No revision
No revision
1.3.2.1 +12 -5 mlton/basis-library/list/list-pair.sig
Index: list-pair.sig
===================================================================
RCS file: /cvsroot/mlton/mlton/basis-library/list/list-pair.sig,v
retrieving revision 1.3
retrieving revision 1.3.2.1
diff -u -r1.3 -r1.3.2.1
--- list-pair.sig 20 Jul 2002 23:14:01 -0000 1.3
+++ list-pair.sig 20 Jul 2002 23:59:00 -0000 1.3.2.1
@@ -1,11 +1,18 @@
signature LIST_PAIR =
sig
- val all: ('a * 'b -> bool) -> 'a list * 'b list -> bool
+ exception UnequalLengths
+ val zip: 'a list * 'b list -> ('a * 'b) list
+ val zipEq: 'a list * 'b list -> ('a * 'b) list
+ val unzip: ('a * 'b) list -> 'a list * 'b list
val app: ('a * 'b -> unit) -> 'a list * 'b list -> unit
- val exists: ('a * 'b -> bool) -> 'a list * 'b list -> bool
+ val appEq: ('a * 'b -> unit) -> 'a list * 'b list -> unit
+ val map: ('a * 'b -> 'c) -> 'a list * 'b list -> 'c list
+ val mapEq: ('a * 'b -> 'c) -> 'a list * 'b list -> 'c list
val foldl: ('a * 'b * 'c -> 'c) -> 'c -> 'a list * 'b list -> 'c
val foldr: ('a * 'b * 'c -> 'c) -> 'c -> 'a list * 'b list -> 'c
- val map: ('a * 'b -> 'c) -> 'a list * 'b list -> 'c list
- val unzip: ('a * 'b) list -> 'a list * 'b list
- val zip: 'a list * 'b list -> ('a * 'b) list
+ val foldlEq: ('a * 'b * 'c -> 'c) -> 'c -> 'a list * 'b list -> 'c
+ val foldrEq: ('a * 'b * 'c -> 'c) -> 'c -> 'a list * 'b list -> 'c
+ val all: ('a * 'b -> bool) -> 'a list * 'b list -> bool
+ val exists: ('a * 'b -> bool) -> 'a list * 'b list -> bool
+ val allEq: ('a * 'b -> bool) -> 'a list * 'b list -> bool
end
1.4.2.1 +32 -8 mlton/basis-library/list/list-pair.sml
Index: list-pair.sml
===================================================================
RCS file: /cvsroot/mlton/mlton/basis-library/list/list-pair.sml,v
retrieving revision 1.4
retrieving revision 1.4.2.1
diff -u -r1.4 -r1.4.2.1
--- list-pair.sml 20 Jul 2002 23:14:01 -0000 1.4
+++ list-pair.sml 20 Jul 2002 23:59:00 -0000 1.4.2.1
@@ -7,32 +7,46 @@
*)
structure ListPair: LIST_PAIR =
struct
+ exception UnequalLengths
+ fun id x = x
+ fun ul _ = raise UnequalLengths
+
fun unzip l =
List.foldr (fn ((x, y), (xs, ys)) => (x :: xs, y :: ys)) ([], []) l
- fun foldl f b (l1, l2) =
+ fun foldl' w f b (l1, l2) =
let
fun loop(l1, l2, b) =
case (l1, l2) of
(x1 :: l1, x2 :: l2) => loop(l1, l2, f(x1, x2, b))
- | _ => b
+ | _ => w b
in loop(l1, l2, b)
end
+ fun foldl f = foldl' id f
+ fun foldlEq f = foldl' ul f
- fun foldr f b (l1, l2) =
+ fun foldr' w f b (l1, l2) =
let
fun loop(l1, l2) =
case (l1, l2) of
(x1 :: l1, x2 :: l2) => f(x1, x2, loop(l1, l2))
- | _ => b
+ | _ => w b
in loop(l1, l2)
end
+ fun foldr f = foldr' id f
+ fun foldrEq f = foldr' ul f
- fun zip(l1, l2) = rev(foldl (fn (x, x', l) => (x, x') :: l) [] (l1, l2))
+ fun zip' w (l1, l2) = rev(foldl' w (fn (x, x', l) => (x, x') :: l) [] (l1, l2))
+ fun zip(l1, l2) = zip' id (l1, l2)
+ fun zipEq(l1, l2) = zip' ul (l1, l2)
- fun map f = rev o (foldl (fn (x1, x2, l) => f(x1, x2) :: l) [])
+ fun map' w f = rev o (foldl' w (fn (x1, x2, l) => f(x1, x2) :: l) [])
+ fun map f = map' id f
+ fun mapEq f = map' ul f
- fun app f = foldl (fn (x1, x2, ()) => f(x1, x2)) ()
+ fun app' w f = foldl' w (fn (x1, x2, ()) => f(x1, x2)) ()
+ fun app f = app' id f
+ fun appEq f = app' ul f
fun exists p (l1, l2) =
let
@@ -42,6 +56,16 @@
| _ => false
in loop(l1, l2)
end
-
+
fun all p ls = not(exists (not o p) ls)
+
+ fun allEq p =
+ let
+ fun loop(l1, l2) =
+ case (l1, l2) of
+ ([], []) => true
+ | (x1 :: l1, x2 :: l2) => p(x1, x2) andalso loop(l1, l2)
+ | _ => false
+ in loop
+ end
end
1.3.2.1 +17 -16 mlton/basis-library/list/list.sig
Index: list.sig
===================================================================
RCS file: /cvsroot/mlton/mlton/basis-library/list/list.sig,v
retrieving revision 1.3
retrieving revision 1.3.2.1
diff -u -r1.3 -r1.3.2.1
--- list.sig 20 Jul 2002 23:14:01 -0000 1.3
+++ list.sig 20 Jul 2002 23:59:01 -0000 1.3.2.1
@@ -4,34 +4,35 @@
exception Empty
+ val null: 'a list -> bool
+ val length: 'a list -> int
val @ : 'a list * 'a list -> 'a list
+ val hd: 'a list -> 'a
+ val tl: 'a list -> 'a list
+ val rev: 'a list -> 'a list
val app: ('a -> unit) -> 'a list -> unit
+ val map: ('a -> 'b) -> 'a list -> 'b list
val foldl: ('a * 'b -> 'b) -> 'b -> 'a list -> 'b
val foldr: ('a * 'b -> 'b) -> 'b -> 'a list -> 'b
- val hd: 'a list -> 'a
- val length: 'a list -> int
- val map: ('a -> 'b) -> 'a list -> 'b list
- val null: 'a list -> bool
- val rev: 'a list -> 'a list
- val tl: 'a list -> 'a list
end
signature LIST =
sig
include LIST_GLOBAL
- val all: ('a -> bool) -> 'a list -> bool
- val concat: 'a list list -> 'a list
- val drop: 'a list * int -> 'a list
- val exists: ('a -> bool) -> 'a list -> bool
- val filter: ('a -> bool) -> 'a list -> 'a list
- val find: ('a -> bool) -> 'a list -> 'a option
- val getItem: 'a list -> ('a * 'a list) option
val last: 'a list -> 'a
- val mapPartial: ('a -> 'b option) -> 'a list -> 'b list
+ val getItem: 'a list -> ('a * 'a list) option
val nth: 'a list * int -> 'a
- val partition: ('a -> bool) -> 'a list -> 'a list * 'a list
+ val take: 'a list * int -> 'a list
+ val drop: 'a list * int -> 'a list
+ val concat: 'a list list -> 'a list
val revAppend: 'a list * 'a list -> 'a list
+ val mapPartial: ('a -> 'b option) -> 'a list -> 'b list
+ val find: ('a -> bool) -> 'a list -> 'a option
+ val filter: ('a -> bool) -> 'a list -> 'a list
+ val partition: ('a -> bool) -> 'a list -> 'a list * 'a list
+ val exists: ('a -> bool) -> 'a list -> bool
+ val all: ('a -> bool) -> 'a list -> bool
val tabulate: int * (int -> 'a) -> 'a list
- val take: 'a list * int -> 'a list
+ val collate: ('a * 'a -> order) -> 'a list * 'a list -> order
end
1.5.2.1 +12 -0 mlton/basis-library/list/list.sml
Index: list.sml
===================================================================
RCS file: /cvsroot/mlton/mlton/basis-library/list/list.sml,v
retrieving revision 1.5
retrieving revision 1.5.2.1
diff -u -r1.5 -r1.5.2.1
--- list.sml 20 Jul 2002 23:14:01 -0000 1.5
+++ list.sml 20 Jul 2002 23:59:01 -0000 1.5.2.1
@@ -143,6 +143,18 @@
else loop (i + 1, f i :: ac)
in loop (0, [])
end
+
+ fun collate cmp =
+ let
+ val rec loop =
+ fn ([], []) => EQUAL
+ | ([], _) => LESS
+ | (_, []) => GREATER
+ | (x1::l1,x2::l2) => (case cmp (x1, x2) of
+ EQUAL => loop (l1, l2)
+ | ans => ans)
+ in loop
+ end
end
structure ListGlobal: LIST_GLOBAL = List
No revision
No revision
1.3.2.1 +5 -5 mlton/basis-library/real/IEEE-real.sig
Index: IEEE-real.sig
===================================================================
RCS file: /cvsroot/mlton/mlton/basis-library/real/IEEE-real.sig,v
retrieving revision 1.3
retrieving revision 1.3.2.1
diff -u -r1.3 -r1.3.2.1
--- IEEE-real.sig 20 Jul 2002 23:14:01 -0000 1.3
+++ IEEE-real.sig 20 Jul 2002 23:59:01 -0000 1.3.2.1
@@ -4,10 +4,8 @@
datatype real_order = LESS | EQUAL | GREATER | UNORDERED
- datatype nan_mode = QUIET | SIGNALLING
-
datatype float_class =
- NAN of nan_mode
+ NAN
| INF
| ZERO
| NORMAL
@@ -22,12 +20,14 @@
val setRoundingMode: rounding_mode -> unit
val getRoundingMode: unit -> rounding_mode
- type decimal_approx = {kind: float_class,
+ type decimal_approx = {class: float_class,
sign: bool,
digits: int list,
exp: int}
val toString: decimal_approx -> string
-(* val fromString: string -> decimal_approx option*)
+(* val scan: (char, 'a) StringCvt.reader
+ -> (decimal_approx, 'a) StringCvt.reader *)
+(* val fromString: string -> decimal_approx option *)
end
1.4.2.1 +5 -6 mlton/basis-library/real/IEEE-real.sml
Index: IEEE-real.sml
===================================================================
RCS file: /cvsroot/mlton/mlton/basis-library/real/IEEE-real.sml,v
retrieving revision 1.4
retrieving revision 1.4.2.1
diff -u -r1.4 -r1.4.2.1
--- IEEE-real.sml 20 Jul 2002 23:14:01 -0000 1.4
+++ IEEE-real.sml 20 Jul 2002 23:59:01 -0000 1.4.2.1
@@ -9,10 +9,9 @@
struct
exception Unordered
datatype real_order = LESS | EQUAL | GREATER | UNORDERED
- datatype nan_mode = QUIET | SIGNALLING
datatype float_class =
- NAN of nan_mode
+ NAN
| INF
| ZERO
| NORMAL
@@ -42,12 +41,12 @@
val setRoundingMode = Prim.setRoundingMode o rounding_modeToInt
val getRoundingMode = intToRounding_mode o Prim.getRoundingMode
- type decimal_approx = {kind: float_class,
+ type decimal_approx = {class: float_class,
sign: bool,
digits: int list,
exp: int}
- fun toString{kind, sign, digits, exp}: string =
+ fun toString {class, sign, digits, exp}: string =
let
fun digitStr() = implode(map StringCvt.digitToChar digits)
fun norm() =
@@ -57,12 +56,12 @@
else concat[num, "E", Int.toString exp]
end
val num =
- case kind of
+ case class of
ZERO => "0.0"
| NORMAL => norm()
| SUBNORMAL => norm()
| INF => "inf"
- | NAN _ => concat["nan(", digitStr(), ")"]
+ | NAN => "nan"
in if sign
then "~" ^ num
else num
1.4.2.1 +10 -10 mlton/basis-library/real/math.sig
Index: math.sig
===================================================================
RCS file: /cvsroot/mlton/mlton/basis-library/real/math.sig,v
retrieving revision 1.4
retrieving revision 1.4.2.1
diff -u -r1.4 -r1.4.2.1
--- math.sig 20 Jul 2002 23:14:01 -0000 1.4
+++ math.sig 20 Jul 2002 23:59:01 -0000 1.4.2.1
@@ -2,21 +2,21 @@
sig
type real
- val acos: real -> real
+ val pi: real
+ val e: real
+ val sqrt: real -> real
+ val sin: real -> real
+ val cos: real -> real
+ val tan: real -> real
val asin: real -> real
- val atan2: real * real -> real
+ val acos: real -> real
val atan: real -> real
- val cos: real -> real
- val cosh: real -> real
- val e: real
+ val atan2: real * real -> real
val exp: real -> real
+ val pow: real * real -> real
val ln: real -> real
val log10: real -> real
- val pi: real
- val pow: real * real -> real
- val sin: real -> real
val sinh: real -> real
- val sqrt: real -> real
- val tan: real -> real
+ val cosh: real -> real
val tanh: real -> real
end
1.3.2.1 +3 -3 mlton/basis-library/real/pack-real.sig
Index: pack-real.sig
===================================================================
RCS file: /cvsroot/mlton/mlton/basis-library/real/pack-real.sig,v
retrieving revision 1.3
retrieving revision 1.3.2.1
diff -u -r1.3 -r1.3.2.1
--- pack-real.sig 20 Jul 2002 23:14:01 -0000 1.3
+++ pack-real.sig 20 Jul 2002 23:59:01 -0000 1.3.2.1
@@ -3,10 +3,10 @@
type real
val bytesPerElem: int
- val fromBytes: Word8Vector.vector -> real
val isBigEndian: bool
- val subArr: Word8Array.array * int -> real
- val subVec: Word8Vector.vector * int -> real
val toBytes: real -> Word8Vector.vector
+ val fromBytes: Word8Vector.vector -> real
+ val subVec: Word8Vector.vector * int -> real
+ val subArr: Word8Array.array * int -> real
val update: Word8Array.array * int * real -> unit
end
1.3.2.1 +2 -0 mlton/basis-library/real/pack-real.sml
Index: pack-real.sml
===================================================================
RCS file: /cvsroot/mlton/mlton/basis-library/real/pack-real.sml,v
retrieving revision 1.3
retrieving revision 1.3.2.1
diff -u -r1.3 -r1.3.2.1
--- pack-real.sml 20 Jul 2002 23:14:01 -0000 1.3
+++ pack-real.sml 20 Jul 2002 23:59:01 -0000 1.3.2.1
@@ -29,3 +29,5 @@
fun subArr (a, i) = subVec (Primitive.Vector.fromArray a, i)
end
+
+structure PackRealLittle = PackReal64Little
1.3.2.1 +48 -43 mlton/basis-library/real/real.sig
Index: real.sig
===================================================================
RCS file: /cvsroot/mlton/mlton/basis-library/real/real.sig,v
retrieving revision 1.3
retrieving revision 1.3.2.1
diff -u -r1.3 -r1.3.2.1
--- real.sig 20 Jul 2002 23:14:01 -0000 1.3
+++ real.sig 20 Jul 2002 23:59:01 -0000 1.3.2.1
@@ -1,3 +1,8 @@
+structure Real =
+ struct
+ type real = real
+ end
+
structure LargeReal =
struct
type real = real
@@ -5,8 +10,8 @@
signature REAL_GLOBAL =
sig
- structure Math: MATH
type real
+ structure Math: MATH where type real = real
val ceil: real -> Int.int
val floor: real -> Int.int
@@ -18,61 +23,61 @@
sig
include REAL_GLOBAL
- val != : real * real -> bool
- val * : real * real -> real
- val *+ : real * real * real -> real
- val *- : real * real * real -> real
+ val radix: int
+ val precision: int
+ val maxFinite: real
+ val minPos: real
+ val minNormalPos: real
+ val posInf: real
+ val negInf: real
val + : real * real -> real
val - : real * real -> real
+ val * : real * real -> real
val / : real * real -> real
+ val rem: real * real -> real
+ val *+ : real * real * real -> real
+ val *- : real * real * real -> real
+ val ~ : real -> real
+ val abs: real -> real
+ val min: real * real -> real
+ val max: real * real -> real
+ val sign: real -> int
+ val signBit: real -> bool
+ val sameSign: real * real -> bool
+ val copySign: real * real -> real
+ val compare: real * real -> order
+ val compareReal: real * real -> IEEEReal.real_order
val < : real * real -> bool
val <= : real * real -> bool
- val == : real * real -> bool
val > : real * real -> bool
val >= : real * real -> bool
+ val == : real * real -> bool
+ val != : real * real -> bool
val ?= : real * real -> bool
- val abs: real -> real
- val checkFloat: real -> real
- val class: real -> IEEEReal.float_class
- val compare: real * real -> order
- val compareReal: real * real -> IEEEReal.real_order
- val copySign: real * real -> real
- val fmt: StringCvt.realfmt -> real -> string
- val fromInt: int -> real
- val fromLarge: IEEEReal.rounding_mode -> LargeReal.real -> real
- val fromManExp: {man: real, exp: int} -> real
- val fromString: string -> real option
+ val unordered: real * real -> bool
val isFinite: real -> bool
val isNan: real -> bool
val isNormal: real -> bool
- val max: real * real -> real
- val maxFinite: real
- val min: real * real -> real
- val minNormalPos: real
- val minPos: real
- val negInf: real
- val posInf: real
- val precision: int
- val radix: int
- val realCeil: real -> real
- val realFloor: real -> real
- val realMod: real -> real
- val realTrunc: real -> real
- val rem: real * real -> real
- val sameSign: real * real -> bool
+ val class: real -> IEEEReal.float_class
+ val fmt: StringCvt.realfmt -> real -> string
+ val toString: real -> string
val scan: (char, 'a) StringCvt.reader -> (real, 'a) StringCvt.reader
- val sign: real -> int
- val signBit: real -> bool
+ val fromString: string -> real option
+ val toManExp: real -> {man: real, exp: int}
+ val fromManExp: {man: real, exp: int} -> real
val split: real -> {whole: real, frac: real}
+ val realMod: real -> real
+(* val nextAfter: real * real -> real *)
+ val checkFloat: real -> real
+ val realFloor: real -> real
+ val realCeil: real -> real
+ val realTrunc: real -> real
val toInt: IEEEReal.rounding_mode -> real -> int
+(* val toLargeInt: IEEEReal.rounding_mode -> real -> LargeInt.int *)
+ val fromInt: int -> real
+(* val fromLargeInt: LargeInt.int -> real *)
val toLarge: real -> LargeReal.real
- val toManExp: real -> {man: real, exp: int}
- val toString: real -> string
- val unordered: real * real -> bool
- val ~ : real -> real
-(* val nextAfter: real * real -> real *)
-(* val toLargeInt: IEEEReal.rounding_mode -> real -> LargeInt.int *)
-(* val fromLargeInt: LargeInt.int -> real *)
-(* val toDecimal: real -> IEEEReal.decimal_approx *)
-(* val fromDecimal: IEEEReal.decimal_approx -> real *)
+ val fromLarge: IEEEReal.rounding_mode -> LargeReal.real -> real
+(* val toDecimal: real -> IEEEReal.decimal_approx *)
+(* val fromDecimal: IEEEReal.decimal_approx -> real option *)
end
1.13.2.1 +28 -9 mlton/basis-library/real/real.sml
Index: real.sml
===================================================================
RCS file: /cvsroot/mlton/mlton/basis-library/real/real.sml,v
retrieving revision 1.13
retrieving revision 1.13.2.1
diff -u -r1.13 -r1.13.2.1
--- real.sml 20 Jul 2002 23:14:01 -0000 1.13
+++ real.sml 20 Jul 2002 23:59:01 -0000 1.13.2.1
@@ -7,7 +7,7 @@
*
*)
-structure Real: REAL =
+structure Real64: REAL =
struct
structure Real = Primitive.Real
open Real IEEEReal
@@ -81,8 +81,8 @@
(* See runtime/basis/Real.c for the integers returned by class. *)
fun class x =
case Real.class x of
- 0 => NAN QUIET
- | 1 => NAN SIGNALLING
+ 0 => NAN (* QUIET *)
+ | 1 => NAN (* SIGNALLING *)
| 2 => INF
| 3 => ZERO
| 4 => NORMAL
@@ -132,7 +132,7 @@
let fun doit () = withRoundingMode (mode, fn () =>
Real.toInt (Real.round x))
in case class x of
- NAN _ => raise Domain
+ NAN => raise Domain
| INF => raise Overflow
| ZERO => 0
| NORMAL =>
@@ -179,7 +179,7 @@
local
fun round mode x =
case class x of
- NAN _ => x
+ NAN => x
| INF => x
| _ => withRoundingMode (mode, fn () => Real.round x)
in
@@ -242,7 +242,7 @@
| EXACT => raise Fail "Real.fmt EXACT unimplemented"
in fn x =>
case class x of
- NAN _ => "nan" (* this is wrong *)
+ NAN => "nan"
| INF => if x > 0.0 then "inf" else "~inf"
| ZERO => "0.0"
| _ =>
@@ -321,6 +321,23 @@
| SOME (#"~", rest) => (false, rest)
| _ => (true, src )
+ fun sym src =
+ case getc src of
+ SOME (#"i", restA) =>
+ (case Reader.reader2 getc restA of
+ SOME ((#"n", #"f"), restB) =>
+ SOME (posInf,
+ case Reader.readerN (getc, 5) restB of
+ SOME ([#"i", #"n", #"i", #"t", #"y"], restC) => restC
+ | _ => restB)
+ | _ => NONE)
+ | SOME (#"n", restA) =>
+ (case Reader.reader2 getc restA of
+ SOME ((#"a", #"n"), restB) =>
+ SOME (nan, restB)
+ | _ => NONE)
+ | _ => NONE
+
val src = StringCvt.dropl Char.isSpace getc source
val (manpos, src1) = sign src
val (intg, src2) = getint src1
@@ -349,14 +366,16 @@
| (SOME ival, true, NONE ) => mkres ival src2
| (SOME ival, false, NONE ) => expopt ival src2
| (SOME ival, _ , SOME fval) => expopt (ival+fval) src4
- | _ => NONE
+ | _ => (case sym src1 of
+ SOME (v, rest) => mkres v rest
+ | NONE => NONE)
end
fun fromString s = StringCvt.scanString scan s
end
+structure Real = Real64
+structure LargeReal = Real64
structure RealGlobal: REAL_GLOBAL = Real
open RealGlobal
val real = Real.fromInt
-
-structure LargeReal: REAL = Real
No revision
No revision
1.3.2.1 +2 -0 mlton/basis-library/top-level/overloads.sml
Index: overloads.sml
===================================================================
RCS file: /cvsroot/mlton/mlton/basis-library/top-level/overloads.sml,v
retrieving revision 1.3
retrieving revision 1.3.2.1
diff -u -r1.3 -r1.3.2.1
--- overloads.sml 31 May 2002 16:23:35 -0000 1.3
+++ overloads.sml 20 Jul 2002 23:59:01 -0000 1.3.2.1
@@ -9,6 +9,8 @@
_overload ~ : ('a -> 'a)
as Int.~
and IntInf.~
+and Word.~
+and Word8.~
and Real.~
_overload + : ('a * 'a -> 'a)
1.7.2.1 +78 -28 mlton/basis-library/top-level/top-level.sml
Index: top-level.sml
===================================================================
RCS file: /cvsroot/mlton/mlton/basis-library/top-level/top-level.sml,v
retrieving revision 1.7
retrieving revision 1.7.2.1
diff -u -r1.7 -r1.7.2.1
--- top-level.sml 20 Jul 2002 23:14:01 -0000 1.7
+++ top-level.sml 20 Jul 2002 23:59:01 -0000 1.7.2.1
@@ -56,67 +56,117 @@
signature TIMER = TIMER
signature UNIX = UNIX
signature VECTOR = VECTOR
+signature VECTOR_SLICE = VECTOR_SLICE
signature WORD = WORD
+structure Vector: VECTOR = Vector
+structure VectorSlice:> VECTOR_SLICE where type 'a vector = 'a Vector.vector = VectorSlice
+(* Basis:
+VECTOR_SLICE shouldn't include type 'a vector; should reference 'a Vector.vector directly.
+*)
+(* Basis:
+structure VectorSlice: VECTOR_SLICE
+*)
structure Array: ARRAY = Array
+structure ArraySlice:> ARRAY_SLICE where type 'a array = 'a Array.array
+ and type 'a vector = 'a Vector.vector
+ and type 'a vector_slice = 'a VectorSlice.slice = ArraySlice
+(* Basis:
+ARRAY_SLICE shouldn't include type 'a array, 'a vector, or 'a vector_slice;
+should reference 'a Array.array, 'a Vector.vector, and 'a VectorSlice.slice directly.
+*)
+(* Basis:
+structure ArraySlice: ARRAY_SLICE
+*)
structure Array2: ARRAY2 = Array2
structure BinIO:> BIN_IO = BinIO
structure Bool: BOOL = Bool
-structure BoolArray: MONO_ARRAY = BoolArray
+structure BoolVector:> MONO_VECTOR where type elem = bool = BoolVector
+structure BoolArray:> MONO_ARRAY where type vector = BoolVector.vector
+ where type elem = bool = BoolArray
structure BoolArray2: MONO_ARRAY2 = BoolArray2
-structure BoolVector: MONO_VECTOR = BoolVector
structure Byte: BYTE = Byte
structure Char: CHAR = Char
-structure CharArray: MONO_ARRAY = CharArray
+structure CharVector:> MONO_VECTOR where type vector = String.string
+ where type elem = Char.char = CharVector
+structure CharArray:> MONO_ARRAY where type vector = CharVector.vector
+ where type elem = Char.char = CharArray
+(* Basis:
+structure CharArray:> MONO_ARRAY where type vector = CharVector.vector
+ where type elem = char = CharArray
+*)
structure CharArray2: MONO_ARRAY2 = CharArray2
-structure CharVector: MONO_VECTOR = CharVector
structure CommandLine: COMMAND_LINE = CommandLine
structure Date: DATE = Date
-structure FixedInt: INTEGER = Int32
+structure FixedInt:> INTEGER = Int32
structure General: GENERAL = General
structure IEEEReal: IEEE_REAL = IEEEReal
-structure Int: INTEGER = Int
-structure Int32: INTEGER = Int32
-structure IntArray: MONO_ARRAY = IntArray
+structure Int:> INTEGER = Int
+structure IntVector:> MONO_VECTOR where type elem = int = IntVector
+structure IntArray: MONO_ARRAY where type vector = IntVector.vector
+ where type elem = int = IntArray
structure IntArray2: MONO_ARRAY2 = IntArray2
-structure IntVector: MONO_VECTOR = IntVector
+structure Int32:> INTEGER = Int32
+structure Int32Vector:> MONO_VECTOR where type elem = Int32.int = Int32Vector
+structure Int32Array: MONO_ARRAY where type vector = Int32Vector.vector
+ where type elem = Int32.int = Int32Array
+structure IntInf:> INT_INF = IntInf
+(* Basis:
structure IntInf: INT_INF = IntInf
+*)
structure IO: IO = IO
-structure LargeInt: INTEGER = LargeInt
-structure LargeReal: REAL = LargeReal
-structure LargeWord: WORD = Word
+structure LargeInt:> INTEGER = LargeInt
+structure LargeReal:> REAL = LargeReal
+structure LargeWord:> WORD = Word
structure List: LIST = List
structure ListPair: LIST_PAIR = ListPair
structure Math: MATH = Real.Math
structure Option: OPTION = Option
structure OS: OS = OS
-structure PackRealLittle: PACK_REAL = PackReal64Little
-structure PackReal64Little: PACK_REAL = PackReal64Little
-structure Pack32Big: PACK_WORD = Pack32Big
-structure Pack32Little: PACK_WORD = Pack32Little
-structure Position: INTEGER = Position
+structure Pack32Big:> PACK_WORD = Pack32Big
+structure Pack32Little:> PACK_WORD = Pack32Little
+structure Position:> INTEGER = Position
structure Posix: POSIX = Posix
+(* Funny shuffle with Real and PackRealLittle to get opaque signatures to work out. *)
structure Real: REAL = Real
-structure RealArray: MONO_ARRAY = RealArray
-structure Real64Array: MONO_ARRAY = RealArray
-structure RealArray2: MONO_ARRAY2 = RealArray2
-structure RealVector: MONO_VECTOR = RealVector
+structure PackRealLittle:> PACK_REAL where type real = Real.real = PackRealLittle
+structure Real:> REAL where type real = PackRealLittle.real = Real
+structure RealVector:> MONO_VECTOR where type elem = real = RealVector
+structure RealArray:> MONO_ARRAY where type vector = RealVector.vector
+ where type elem = real = RealArray
+(* Funny shuffle with Real64 and PackReal64Little to get opaque signatures to work out. *)
+structure Real64: REAL = Real64
+structure PackReal64Little:> PACK_REAL where type real = Real64.real = PackReal64Little
+structure Real64:> REAL where type real = PackReal64Little.real = Real64
+structure Real64Vector:> MONO_VECTOR where type elem = Real64.real = Real64Vector
+structure Real64Array:> MONO_ARRAY where type vector = Real64Vector.vector
+ where type elem = Real64.real = Real64Array
structure SML90:> SML90 = SML90
+(* Basis:
+(* structure SML90:> SML90 = SML90 *)
+*)
structure String: STRING = String
structure StringCvt: STRING_CVT = StringCvt
structure Substring: SUBSTRING = Substring
-structure SysWord: WORD = SysWord
+structure SysWord:> WORD = SysWord
structure TextIO:> TEXT_IO = TextIO
structure Time: TIME = Time
structure Timer:> TIMER = Timer
structure Unix: UNIX = Unix
-structure Vector: VECTOR = Vector
-structure Word: WORD = Word
-structure Word8: WORD = Word8
-structure Word8Array: MONO_ARRAY = Word8Array
+structure Word:> WORD = Word
+structure WordVector:> MONO_VECTOR where type elem = word = WordVector
+structure WordArray: MONO_ARRAY where type vector = WordVector.vector
+ where type elem = word = WordArray
+structure WordArray2: MONO_ARRAY2 = WordArray2
+structure Word8:> WORD = Word8
+structure Word8Vector:> MONO_VECTOR where type elem = Word8.word = Word8Vector
+structure Word8Array:> MONO_ARRAY where type vector = Word8Vector.vector
+ where type elem = Word8.word = Word8Array
structure Word8Array2: MONO_ARRAY2 = Word8Array2
-structure Word8Vector: MONO_VECTOR = Word8Vector
-structure Word32: WORD = Word32
+structure Word32:> WORD = Word32
+structure Word32Vector:> MONO_VECTOR where type elem = Word32.word = Word32Vector
+structure Word32Array:> MONO_ARRAY where type vector = Word32Vector.vector
+ where type elem = Word32.word = Word32Array
open
ArrayGlobal
No revision
No revision
1.8.2.1 +1 -1 mlton/doc/user-guide/basis.tex
Index: basis.tex
===================================================================
RCS file: /cvsroot/mlton/mlton/doc/user-guide/basis.tex,v
retrieving revision 1.8
retrieving revision 1.8.2.1
diff -u -r1.8 -r1.8.2.1
--- basis.tex 20 Jul 2002 23:14:01 -0000 1.8
+++ basis.tex 20 Jul 2002 23:59:01 -0000 1.8.2.1
@@ -2,7 +2,7 @@
This section describes the portion that {\mlton} implements of the Standard ML
Basis Library specified at
-\link{http://cm.bell-labs.com/cm/cs/what/smlnj/doc/basis/index.html}.
+\link{http://SML.sourceforge.net/Basis/index.html}.
\subsection{Top level values}
No revision
No revision
1.4.2.1 +2 -0 mlton/lib/mlton/pervasive/pervasive.sml
Index: pervasive.sml
===================================================================
RCS file: /cvsroot/mlton/mlton/lib/mlton/pervasive/pervasive.sml,v
retrieving revision 1.4
retrieving revision 1.4.2.1
diff -u -r1.4 -r1.4.2.1
--- pervasive.sml 20 Jul 2002 23:14:01 -0000 1.4
+++ pervasive.sml 20 Jul 2002 23:59:01 -0000 1.4.2.1
@@ -33,7 +33,9 @@
structure Position = Position
structure Posix = Posix
structure Real = Real
+(*
structure SML90 = SML90
+*)
structure SMLofNJ = SMLofNJ
structure String = String
structure StringCvt = StringCvt
No revision
No revision
1.3.2.1 +1 -1 mlton/regression/real6.ok
Index: real6.ok
===================================================================
RCS file: /cvsroot/mlton/mlton/regression/real6.ok,v
retrieving revision 1.3
retrieving revision 1.3.2.1
diff -u -r1.3 -r1.3.2.1
--- real6.ok 20 Jul 2002 23:14:01 -0000 1.3
+++ real6.ok 20 Jul 2002 23:59:01 -0000 1.3.2.1
@@ -64,7 +64,7 @@
NORMAL
SUBNORMAL
NORMAL
-NAN QUIET
+NAN
INF
INF
INF
1.3.2.1 +2 -3 mlton/regression/real6.sml
Index: real6.sml
===================================================================
RCS file: /cvsroot/mlton/mlton/regression/real6.sml,v
retrieving revision 1.3
retrieving revision 1.3.2.1
diff -u -r1.3 -r1.3.2.1
--- real6.sml 20 Jul 2002 23:14:01 -0000 1.3
+++ real6.sml 20 Jul 2002 23:59:01 -0000 1.3.2.1
@@ -13,8 +13,7 @@
infix 4 == != ?=
val classToString =
- fn NAN QUIET => "NAN QUIET"
- | NAN SIGNALLING => "NAN SIGNALLING"
+ fn NAN => "NAN"
| INF => "INF"
| ZERO => "ZERO"
| NORMAL => "NORMAL"
@@ -40,7 +39,7 @@
[(maxFinite, NORMAL),
(minPos, SUBNORMAL),
(minNormalPos, NORMAL),
- (nan, NAN QUIET),
+ (nan, NAN),
(posInf, INF),
(negInf, INF),
(1.0 / 0.0, INF),
1.3.2.1 +1 -1 mlton/regression/word.sml
Index: word.sml
===================================================================
RCS file: /cvsroot/mlton/mlton/regression/word.sml,v
retrieving revision 1.3
retrieving revision 1.3.2.1
diff -u -r1.3 -r1.3.2.1
--- word.sml 20 Jul 2002 23:14:02 -0000 1.3
+++ word.sml 20 Jul 2002 23:59:01 -0000 1.3.2.1
@@ -77,7 +77,7 @@
val test8b = check (0 = w2i (notb (i2w ~1)));
val _ = pr_ln "test8b" test8b
val maxposint = valOf Int.maxInt;
-val maxnegint = ~maxposint-1;
+val maxnegint = (Int.~ maxposint)-1;
fun pwr2 0 = 1
| pwr2 n = 2 * pwr2 (n-1);
fun rwp i 0 = i
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
MLton-devel mailing list
MLton-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mlton-devel