[MLton-commit] r6488

Vesa Karvonen vesak at mlton.org
Sun Mar 16 10:40:23 PST 2008


Added: sq x = x * x.
----------------------------------------------------------------------

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

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

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/numeric/mk-integer-ext.fun
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/numeric/mk-integer-ext.fun	2008-03-16 08:40:44 UTC (rev 6487)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/numeric/mk-integer-ext.fun	2008-03-16 18:40:22 UTC (rev 6488)
@@ -1,4 +1,4 @@
-(* Copyright (C) 2006-2007 SSH Communications Security, Helsinki, Finland
+(* Copyright (C) 2006-2008 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.
@@ -37,6 +37,7 @@
       fun isZero i = zero = i
       fun isEven i = isZero (rem (i, fromInt 2))
       val isOdd = not o isEven
+      fun sq x = x * x
       val bounds =
           case (minInt, maxInt) of
              (NONE,         NONE) => NONE

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/numeric/mk-real-ext.fun
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/numeric/mk-real-ext.fun	2008-03-16 08:40:44 UTC (rev 6487)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/numeric/mk-real-ext.fun	2008-03-16 18:40:22 UTC (rev 6488)
@@ -1,4 +1,4 @@
-(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+(* Copyright (C) 2006-2008 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.
@@ -7,6 +7,7 @@
 functor MkRealExt (R : BASIS_REAL) : REAL = struct
    open R
    type t = real
+   fun sq x = x * x
    val embDecimal = (toDecimal, fromDecimal)
    val embString = (toString, fromString)
    fun isoInt mode = (toInt mode, fromInt)

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/numeric/mk-word-ext.fun
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/numeric/mk-word-ext.fun	2008-03-16 08:40:44 UTC (rev 6487)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/numeric/mk-word-ext.fun	2008-03-16 18:40:22 UTC (rev 6488)
@@ -1,4 +1,4 @@
-(* Copyright (C) 2006-2007 SSH Communications Security, Helsinki, Finland
+(* Copyright (C) 2006-2008 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.
@@ -140,6 +140,7 @@
       fun isZero w = fromInt 0 = w
       fun isEven w = isZero (andb (fromInt 1, w))
       val isOdd = not o isEven
+      fun sq x = x * x
    end
 
    structure Bounded = MkBounded (Core)

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/public/numeric/integer.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/public/numeric/integer.sig	2008-03-16 08:40:44 UTC (rev 6487)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/public/numeric/integer.sig	2008-03-16 18:40:22 UTC (rev 6488)
@@ -1,4 +1,4 @@
-(* Copyright (C) 2006-2007 SSH Communications Security, Helsinki, Finland
+(* Copyright (C) 2006-2008 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.
@@ -32,6 +32,8 @@
 
    val ~ : t UnOp.t
 
+   val sq : t UnOp.t (** {sq x = x * x} *)
+
    (** == Predicates == *)
 
    val isEven : t UnPr.t

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/public/numeric/real.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/public/numeric/real.sig	2008-03-16 08:40:44 UTC (rev 6487)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/public/numeric/real.sig	2008-03-16 18:40:22 UTC (rev 6488)
@@ -1,4 +1,4 @@
-(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+(* Copyright (C) 2006-2008 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.
@@ -11,6 +11,10 @@
    type t = real
    (** Convenience alias. *)
 
+   (** == Numeric == *)
+
+   val sq : t UnOp.t (** {sq x = x * x} *)
+
    (** == Embeddings == *)
 
    val embDecimal : (t, IEEEReal.decimal_approx) Emb.t

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/public/numeric/word.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/public/numeric/word.sig	2008-03-16 08:40:44 UTC (rev 6487)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/public/numeric/word.sig	2008-03-16 18:40:22 UTC (rev 6488)
@@ -1,4 +1,4 @@
-(* Copyright (C) 2006-2007 SSH Communications Security, Helsinki, Finland
+(* Copyright (C) 2006-2008 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.
@@ -22,6 +22,8 @@
 
    val ~ : t UnOp.t
 
+   val sq : t UnOp.t (** {sq x = x * x} *)
+
    (** == Bounds == *)
 
    val wordSize : Int.int




More information about the MLton-commit mailing list