[MLton-commit] r6252
Vesa Karvonen
vesak at mlton.org
Sun Dec 9 12:18:54 PST 2007
Added conversions to/from minutes and hours into Time : TIME.
----------------------------------------------------------------------
U mltonlib/trunk/com/ssh/extended-basis/unstable/detail/ml/smlnj/unsealed.cm
A mltonlib/trunk/com/ssh/extended-basis/unstable/detail/time/
A mltonlib/trunk/com/ssh/extended-basis/unstable/detail/time/time.sml
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/time/time.sig
----------------------------------------------------------------------
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/ml/smlnj/unsealed.cm
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/ml/smlnj/unsealed.cm 2007-12-09 20:05:31 UTC (rev 6251)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/ml/smlnj/unsealed.cm 2007-12-09 20:18:53 UTC (rev 6252)
@@ -78,6 +78,7 @@
../../../detail/sequence/vector-slice.sml
../../../detail/sequence/vector.sml
../../../detail/text/mk-text-ext.fun
+ ../../../detail/time/time.sml
../../../detail/typing/phantom.sml
../../../public/lazy/lazy.sig
ext.sml
Added: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/time/time.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/time/time.sml 2007-12-09 20:05:31 UTC (rev 6251)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/time/time.sml 2007-12-09 20:18:53 UTC (rev 6252)
@@ -0,0 +1,16 @@
+(* Copyright (C) 2007 Vesa Karvonen
+ *
+ * This code is released under the MLton license, a BSD-style license.
+ * See the LICENSE file or http://mlton.org/License for details.
+ *)
+
+structure Time = struct
+ open Time
+ local
+ fun mk f =
+ (fn v => fromSeconds (v * f), fn t => LargeInt.quot (toSeconds t, f))
+ in
+ val (fromMinutes, toMinutes) = mk (60 * 60)
+ val (fromHours, toHours) = mk 60
+ end
+end
Property changes on: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/time/time.sml
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/extensions.mlb
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/extensions.mlb 2007-12-09 20:05:31 UTC (rev 6251)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/extensions.mlb 2007-12-09 20:18:53 UTC (rev 6252)
@@ -309,6 +309,7 @@
(* Time *)
public/time/time.sig
+ detail/time/time.sml
in
public/export/$(SML_COMPILER).sml
public/export/common.sml
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/extensions.use
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/extensions.use 2007-12-09 20:05:31 UTC (rev 6251)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/extensions.use 2007-12-09 20:18:53 UTC (rev 6252)
@@ -161,6 +161,7 @@
"detail/os/os.sml",
"detail/concept/mk-word-flags.fun",
"public/time/time.sig",
+ "detail/time/time.sml",
"public/export/${SML_COMPILER}.sml",
"public/export/common.sml",
"public/export/top-level.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-12-09 20:05:31 UTC (rev 6251)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/public/export/common.sml 2007-12-09 20:18:53 UTC (rev 6252)
@@ -119,12 +119,13 @@
(*
* These structures are mentioned separately here, rather than in the
- * below list sorted alphabetically, because otherwise SML/NJ (v110.65)
+ * below list sorted alphabetically, because otherwise SML/NJ (v110.66)
* barfs.
*)
structure Sq : SQ = Sq
structure Sum : SUM = Sum
structure Thunk : THUNK = Thunk
+structure Time : TIME = Time
structure UnOp : UN_OP = UnOp
structure UnPr : UN_PR = UnPr
structure Univ : UNIV = Univ
@@ -181,7 +182,6 @@
structure Text : TEXT = Text
structure TextIO : TEXT_IO = TextIO
structure Tie : TIE = Tie
-structure Time : TIME = Time
structure Unit : UNIT = Unit
structure VectorSlice : VECTOR_SLICE = VectorSlice
structure Void : VOID = Void
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/public/time/time.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/public/time/time.sig 2007-12-09 20:05:31 UTC (rev 6251)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/public/time/time.sig 2007-12-09 20:18:53 UTC (rev 6252)
@@ -10,4 +10,8 @@
signature TIME = sig
include BASIS_TIME
type t = time
+ val fromHours : LargeInt.t -> t
+ val fromMinutes : LargeInt.t -> t
+ val toHours : t -> LargeInt.t
+ val toMinutes : t -> LargeInt.t
end
More information about the MLton-commit
mailing list