[MLton-commit] r5292
Vesa Karvonen
vesak at mlton.org
Thu Feb 22 05:24:27 PST 2007
Added MkWordFlags. Also exported concept signatures.
----------------------------------------------------------------------
A mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-word-flags.fun
U mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/sigs.cm
U mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/unsealed.cm
U mltonlib/trunk/com/ssh/extended-basis/unstable/extensions.mlb
U mltonlib/trunk/com/ssh/extended-basis/unstable/extensions.use
U mltonlib/trunk/com/ssh/extended-basis/unstable/public/export/common.sml
U mltonlib/trunk/com/ssh/extended-basis/unstable/public/export/mlton.sml
----------------------------------------------------------------------
Added: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-word-flags.fun
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-word-flags.fun 2007-02-22 12:05:09 UTC (rev 5291)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-word-flags.fun 2007-02-22 13:23:13 UTC (rev 5292)
@@ -0,0 +1,20 @@
+(* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland
+ *
+ * This code is released under the MLton license, a BSD-style license.
+ * See the LICENSE file or http://mlton.org/License for details.
+ *)
+
+functor MkWordFlags (Arg : WORD) : FLAGS = struct
+ open Arg
+ type flags = t
+ type flags_word = t
+ val toWord = Fn.id
+ val fromWord = Fn.id
+ val isoWord = Iso.id
+ val (none, all) = bounds
+ val flags = foldl orb none
+ val intersect = foldl andb all
+ fun clear (f1, f2) = andb (notb f1, f2)
+ fun allSet (f1, f2) = f1 = andb (f1, f2)
+ fun anySet (f1, f2) = none <> andb (f1, f2)
+end
Property changes on: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-word-flags.fun
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/sigs.cm
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/sigs.cm 2007-02-22 12:05:09 UTC (rev 5291)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/sigs.cm 2007-02-22 13:23:13 UTC (rev 5292)
@@ -8,6 +8,12 @@
group(funs.cm)
source(-)
is
+ ../../public/concept/bitwise.sig
+ ../../public/concept/cstringable.sig
+ ../../public/concept/flags.sig
+ ../../public/concept/ordered.sig
+ ../../public/concept/signed.sig
+ ../../public/concept/stringable.sig
../../public/data/bool.sig
../../public/data/exn.sig
../../public/data/option.sig
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/unsealed.cm
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/unsealed.cm 2007-02-22 12:05:09 UTC (rev 5291)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/unsealed.cm 2007-02-22 13:23:13 UTC (rev 5292)
@@ -29,6 +29,7 @@
../fn.sml
../iso.sml
../list.sml
+ ../mk-word-flags.fun
../option.sml
../order.sml
../pair.sml
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/extensions.mlb
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/extensions.mlb 2007-02-22 12:05:09 UTC (rev 5291)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/extensions.mlb 2007-02-22 13:23:13 UTC (rev 5292)
@@ -35,6 +35,14 @@
(* Minimal modules for bootstrapping. *)
detail/bootstrap.sml
+ (* Concept signatures *)
+ public/concept/bitwise.sig
+ public/concept/cstringable.sig
+ public/concept/flags.sig
+ public/concept/ordered.sig
+ public/concept/signed.sig
+ public/concept/stringable.sig
+
(* Compiler specific extensions (if any). *)
basis Ext = bas detail/$(SML_COMPILER)/extensions.mlb end
@@ -209,13 +217,19 @@
basis ShiftOp = bas public/fn/shift-op.sig end
basis TextIO = bas public/io/text-io.sig detail/text-io.sml end
+ basis MkWordFlags = let
+ open Fn Iso Scalars
+ in
+ bas detail/mk-word-flags.fun end
+ end
+
open BinFn BinOp BinPr Bool Buffer
open Cmp
open Effect Emb Exit Exn
open Fix Fn
open Iso
open List
- open MonoSeqs
+ open MkWordFlags MonoSeqs
open Option Order
open Products Promise
open Reader Ref
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/extensions.use
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/extensions.use 2007-02-22 12:05:09 UTC (rev 5291)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/extensions.use 2007-02-22 13:23:13 UTC (rev 5292)
@@ -13,6 +13,12 @@
app use
["detail/"^compiler^"/workarounds.use",
"detail/bootstrap.sml",
+ "public/concept/bitwise.sig",
+ "public/concept/cstringable.sig",
+ "public/concept/flags.sig",
+ "public/concept/ordered.sig",
+ "public/concept/signed.sig",
+ "public/concept/stringable.sig",
"detail/"^compiler^"/extensions.use",
"public/fn/fn.sig", "detail/fn.sml",
"public/data/unit.sig",
@@ -91,6 +97,7 @@
"public/lazy/promise.sig", "detail/promise.sml",
"public/fn/shift-op.sig",
"public/io/text-io.sig", "detail/text-io.sml",
+ "detail/mk-word-flags.fun",
"detail/"^compiler^"/forget.use",
"public/export/"^compiler^".sml",
"public/export/common.sml",
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/public/export/common.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/public/export/common.sml 2007-02-22 12:05:09 UTC (rev 5291)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/public/export/common.sml 2007-02-22 13:23:13 UTC (rev 5292)
@@ -6,6 +6,16 @@
(** == Implementation independent extensions == *)
+(** === Concept Signatures === *)
+
+signature BITWISE = BITWISE
+signature CSTRINGABLE = CSTRINGABLE
+signature ORDERED = ORDERED
+signature SIGNED = SIGNED
+signature STRINGABLE = STRINGABLE
+
+(** === Module Signatures === *)
+
signature ARRAY = ARRAY
signature ARRAY_SLICE = ARRAY_SLICE
signature BIN_FN = BIN_FN
@@ -24,7 +34,6 @@
signature INTEGER = INTEGER
signature INT_INF = INT_INF
signature ISO = ISO
-signature ISO = ISO
signature LIST = LIST
signature MONO_ARRAY = MONO_ARRAY
signature MONO_ARRAY_SLICE = MONO_ARRAY_SLICE
@@ -58,6 +67,8 @@
signature WORD = WORD
signature WRITER = WRITER
+(** === Modules === *)
+
structure Sq : SQ = Sq
structure Sum : SUM = Sum
structure Thunk : THUNK = Thunk
@@ -117,3 +128,7 @@
structure Word8ArraySlice : MONO_ARRAY_SLICE = Word8ArraySlice
structure Word8Vector : MONO_VECTOR = Word8Vector
structure Word8VectorSlice : MONO_VECTOR_SLICE = Word8VectorSlice
+
+(** === Functors === *)
+
+functor MkWordFlags (Arg : WORD) : FLAGS = MkWordFlags (Arg)
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/public/export/mlton.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/public/export/mlton.sml 2007-02-22 12:05:09 UTC (rev 5291)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/public/export/mlton.sml 2007-02-22 13:23:13 UTC (rev 5292)
@@ -92,6 +92,7 @@
structure RealVector : MONO_VECTOR = RealVector
structure RealVectorSlice : MONO_VECTOR_SLICE = RealVectorSlice
structure SysWord : WORD = SysWord
+structure SysWordFlags : FLAGS = MkWordFlags (SysWord)
structure Word1 : WORD = Word1
structure Word10 : WORD = Word10
structure Word11 : WORD = Word11
@@ -102,6 +103,7 @@
structure Word16 : WORD = Word16
structure Word16Array : MONO_ARRAY = Word16Array
structure Word16ArraySlice : MONO_ARRAY_SLICE = Word16ArraySlice
+structure Word16Flags : FLAGS = MkWordFlags (Word16)
structure Word16Vector : MONO_VECTOR = Word16Vector
structure Word16VectorSlice : MONO_VECTOR_SLICE = Word16VectorSlice
structure Word17 : WORD = Word17
@@ -124,6 +126,7 @@
structure Word32 : WORD = Word32
structure Word32Array : MONO_ARRAY = Word32Array
structure Word32ArraySlice : MONO_ARRAY_SLICE = Word32ArraySlice
+structure Word32Flags : FLAGS = MkWordFlags (Word32)
structure Word32Vector : MONO_VECTOR = Word32Vector
structure Word32VectorSlice : MONO_VECTOR_SLICE = Word32VectorSlice
structure Word4 : WORD = Word4
@@ -132,6 +135,7 @@
structure Word64 : WORD = Word64
structure Word64Array : MONO_ARRAY = Word64Array
structure Word64ArraySlice : MONO_ARRAY_SLICE = Word64ArraySlice
+structure Word64Flags : FLAGS = MkWordFlags (Word64)
structure Word64Vector : MONO_VECTOR = Word64Vector
structure Word64VectorSlice : MONO_VECTOR_SLICE = Word64VectorSlice
structure Word7 : WORD = Word7
More information about the MLton-commit
mailing list