[MLton-commit] r4823

Vesa Karvonen vesak at mlton.org
Tue Nov 14 09:39:39 PST 2006


Added isomorphisms between words and big/little endian byte vectors.

----------------------------------------------------------------------

U   mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-word-ext.fun
U   mltonlib/trunk/com/ssh/extended-basis/unstable/public/word.sig

----------------------------------------------------------------------

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-word-ext.fun
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-word-ext.fun	2006-11-14 17:08:09 UTC (rev 4822)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-word-ext.fun	2006-11-14 17:39:39 UTC (rev 4823)
@@ -41,12 +41,14 @@
    val toWord = Word.fromLarge o toLarge
    val toWordX = Word.fromLarge o toLargeX
    val embString = (toString, fromString)
+   val isoBigBytes = (toBigBytes, fromBigBytes)
    val isoInt = (toInt, fromInt)
    val isoIntX = (toIntX, fromInt)
    val isoLarge = (toLarge, fromLarge)
    val isoLargeInt = (toLargeInt, fromLargeInt)
    val isoLargeIntX = (toLargeIntX, fromLargeInt)
    val isoLargeX = (toLargeX, fromLarge)
+   val isoLittleBytes = (toLittleBytes, fromLittleBytes)
    val isoWord = (toWord, fromWord)
    val isoWordX = (toWordX, fromWordX)
    fun isZero w = fromInt 0 = w

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/public/word.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/public/word.sig	2006-11-14 17:08:09 UTC (rev 4822)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/public/word.sig	2006-11-14 17:39:39 UTC (rev 4823)
@@ -116,6 +116,12 @@
 
    (** == Isomorphisms == *)
 
+   val isoBigBytes : (word, Word8Vector.vector) Iso.t
+   (**
+    * An isomorphism between words and byte vectors.  It is always
+    * equivalent to {(toBigBytes, fromBigBytes)}.
+    *)
+
    val isoInt : (word, Int.int) Iso.t
    (**
     * An isomorphism between words of type {word} and the default integer
@@ -152,6 +158,12 @@
     * type.  It is always equivalent to {(toLargeX, fromLarge)}.
     *)
 
+   val isoLittleBytes : (word, Word8Vector.vector) Iso.t
+   (**
+    * An isomorphism between words and byte vectors.  It is always
+    * equivalent to {(toLittleBytes, fromLittleBytes)}.
+    *)
+
    val isoWord : (word, Word.word) Iso.t
    (**
     * An isomorphism between words of type {word} and the default word




More information about the MLton-commit mailing list