[MLton-commit] r6470
Vesa Karvonen
vesak at mlton.org
Thu Mar 13 15:37:49 PST 2008
Added support for those pesky mono vectors.
----------------------------------------------------------------------
U mltonlib/trunk/com/ssh/extended-basis/unstable/detail/bootstrap.sml
U mltonlib/trunk/com/ssh/extended-basis/unstable/detail/ml/common/basis.sml
U mltonlib/trunk/com/ssh/extended-basis/unstable/detail/sequence/mk-buffer-common.fun
U mltonlib/trunk/com/ssh/extended-basis/unstable/public/sequence/buffer.sig
----------------------------------------------------------------------
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/bootstrap.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/bootstrap.sml 2008-03-13 06:45:56 UTC (rev 6469)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/bootstrap.sml 2008-03-13 23:37:48 UTC (rev 6470)
@@ -19,6 +19,7 @@
structure Array = struct open BasisArray type 'a t = 'a array end
structure ArraySlice = struct open BasisArraySlice type 'a t = 'a slice end
structure Char = struct open BasisChar type t = char end
+structure CharArray = struct open BasisCharArray type t = array end
structure CharVector = struct open BasisCharVector type t = vector end
structure Effect = struct type 'a t = 'a -> Unit.t end
structure FixedInt = struct open BasisFixedInt type t = int end
@@ -39,6 +40,7 @@
structure VectorSlice = struct open BasisVectorSlice type 'a t = 'a slice end
structure Word = struct open BasisWord type t = word end
structure Word8 = struct open BasisWord8 type t = word end
+structure Word8Array = struct open BasisWord8Array type t = array end
structure Word8Vector = struct open BasisWord8Vector type t = vector end
structure Pair = struct
type ('a, 'b) pair = 'a * 'b
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/ml/common/basis.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/ml/common/basis.sml 2008-03-13 06:45:56 UTC (rev 6469)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/ml/common/basis.sml 2008-03-13 23:37:48 UTC (rev 6470)
@@ -82,6 +82,7 @@
structure BasisBool = Bool
structure BasisByte = Byte
structure BasisChar = Char
+structure BasisCharArray = CharArray
structure BasisCharVector = CharVector
structure BasisCommandLine = CommandLine
structure BasisDate = Date
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/sequence/mk-buffer-common.fun
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/sequence/mk-buffer-common.fun 2008-03-13 06:45:56 UTC (rev 6469)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/sequence/mk-buffer-common.fun 2008-03-13 23:37:48 UTC (rev 6470)
@@ -5,11 +5,11 @@
*)
functor MkBufferCommon (type 'a elem
- val inj : 'a -> 'a elem
- val prj : 'a elem -> 'a
- val any : 'a -> 'a elem) = struct
- structure A=Array and AS=ArraySlice and L=List and CV=CharVector and V=Vector
- and VS=VectorSlice
+ val inj : 'a -> 'a elem
+ val prj : 'a elem -> 'a
+ val any : 'a -> 'a elem) = struct
+ structure A=Array and AS=ArraySlice and V=Vector and VS=VectorSlice
+ and L=List
datatype 'a t = T of {array : 'a elem A.t Ref.t, length : Int.t Ref.t}
fun the s (T r) = s r
@@ -85,7 +85,10 @@
fun toArray ? = to A.tabulate ?
fun toList ? = to L.tabulate ?
fun toVector ? = to V.tabulate ?
- fun toString ? = to CV.tabulate ?
+ val toString = to CharVector.tabulate
+ val toCharArray = to CharArray.tabulate
+ val toWord8Array = to Word8Array.tabulate
+ val toWord8Vector = to Word8Vector.tabulate
end
fun findSome p b = let
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/public/sequence/buffer.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/public/sequence/buffer.sig 2008-03-13 06:45:56 UTC (rev 6469)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/public/sequence/buffer.sig 2008-03-13 23:37:48 UTC (rev 6470)
@@ -98,6 +98,15 @@
* equivalent to {String.implode (toList b)}.
*)
+ val toCharArray : Char.t t -> CharArray.t
+ (** Returns the contents of a char buffer as a {CharArray}. *)
+
+ val toWord8Array : Word8.t t -> Word8Array.t
+ (** Returns the contents of a {Word8} buffer as a {Word8Array}. *)
+
+ val toWord8Vector : Word8.t t -> Word8Vector.t
+ (** Returns the contents of a {Word8} buffer as a {Word8Vector}. *)
+
val toVector : 'a t -> 'a Vector.t
(**
* Returns the contents of the buffer as a vector. {toVector b} is
More information about the MLton-commit
mailing list