[MLton-commit] r5446
Vesa Karvonen
vesak at mlton.org
Sun Mar 18 15:45:26 PST 2007
Added empty.
----------------------------------------------------------------------
U mltonlib/trunk/com/ssh/extended-basis/unstable/detail/sequence/array.sml
U mltonlib/trunk/com/ssh/extended-basis/unstable/detail/sequence/mk-mono-array-ext.fun
U mltonlib/trunk/com/ssh/extended-basis/unstable/public/sequence/array.sig
U mltonlib/trunk/com/ssh/extended-basis/unstable/public/sequence/mono-array.sig
----------------------------------------------------------------------
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/sequence/array.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/sequence/array.sml 2007-03-18 23:25:23 UTC (rev 5445)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/sequence/array.sml 2007-03-18 23:45:25 UTC (rev 5446)
@@ -10,6 +10,7 @@
in
open Array Common
end
+ fun empty () = tabulate (0, Basic.undefined)
fun duplicate a = tabulate (length a, fn i => sub (a, i))
val toVector = vector
fun fromVector v = tabulate (Vector.length v, fn i => Vector.sub (v, i))
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/sequence/mk-mono-array-ext.fun
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/sequence/mk-mono-array-ext.fun 2007-03-18 23:25:23 UTC (rev 5445)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/sequence/mk-mono-array-ext.fun 2007-03-18 23:45:25 UTC (rev 5446)
@@ -18,6 +18,7 @@
in
open MonoArray Common
end
+ fun empty () = tabulate (0, Basic.undefined)
local
fun mk tabulate length sub ? = tabulate (length ?, fn i => sub (?, i))
in
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/public/sequence/array.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/public/sequence/array.sig 2007-03-18 23:25:23 UTC (rev 5445)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/public/sequence/array.sig 2007-03-18 23:45:25 UTC (rev 5446)
@@ -11,12 +11,19 @@
type 'a t = 'a array
(** Convenience alias. *)
+ (** == Constructors == *)
+
+ val empty : 'a t Thunk.t
+ (** Makes a new empty array. *)
+
val duplicate : 'a t UnOp.t
(**
* Makes a fresh duplicate of the given array. {duplicate a} is
* equivalent to {tabulate (length a, fn i => sub (a, i))}.
*)
+ (** == HOFs == *)
+
val unfoldi : (Int.t * 'b -> 'a * 'b) -> Int.t * 'b -> 'a t * 'b
(**
* {unfoldi f (n, b)} constructs an array a of length {n}, whose
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/public/sequence/mono-array.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/public/sequence/mono-array.sig 2007-03-18 23:25:23 UTC (rev 5445)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/public/sequence/mono-array.sig 2007-03-18 23:45:25 UTC (rev 5446)
@@ -11,12 +11,19 @@
type t = array
(** Convenience alias. *)
- val duplicate : t -> t
+ (** == Constructors == *)
+
+ val empty : t Thunk.t
+ (** Makes a new empty array. *)
+
+ val duplicate : t UnOp.t
(**
* Makes a fresh duplicate of the given array. {duplicate a} is
* equivalent to {tabulate (length a, fn i => sub (a, i))}.
*)
+ (** == HOFs == *)
+
val unfoldi : (Int.t * 'a -> elem * 'a) -> Int.t * 'a -> t * 'a
(**
* {unfoldi f (n, b)} constructs an array a of length {n}, whose
More information about the MLton-commit
mailing list