[MLton-commit] r5019
Vesa Karvonen
vesak at mlton.org
Fri Jan 12 04:24:38 PST 2007
Initial commit of a lib of misc utils to be refactored.
----------------------------------------------------------------------
A mltonlib/trunk/com/ssh/misc-util/unstable/bit-flags.sml
----------------------------------------------------------------------
Added: mltonlib/trunk/com/ssh/misc-util/unstable/bit-flags.sml
===================================================================
--- mltonlib/trunk/com/ssh/misc-util/unstable/bit-flags.sml 2007-01-12 12:24:12 UTC (rev 5018)
+++ mltonlib/trunk/com/ssh/misc-util/unstable/bit-flags.sml 2007-01-12 12:24:34 UTC (rev 5019)
@@ -0,0 +1,21 @@
+(* 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.
+ *)
+
+(**
+ * An implementation of the BIT_FLAGS signature of the Basis Library.
+ *)
+structure BitFlags : BIT_FLAGS = struct
+ open SysWord
+ type flags = t
+ val toWord = id
+ val fromWord = id
+ val (none, all) = bounds
+ val flags = foldl op orb none
+ val intersect = foldl op andb all
+ fun clear (f1, f2) = notb f1 andb f2
+ fun allSet (f1, f2) = f1 = f1 andb f2
+ fun anySet (f1, f2) = none <> f1 andb f2
+end
Property changes on: mltonlib/trunk/com/ssh/misc-util/unstable/bit-flags.sml
___________________________________________________________________
Name: svn:eol-style
+ native
More information about the MLton-commit
mailing list