[MLton-commit] r6306

Vesa Karvonen vesak at mlton.org
Wed Jan 9 09:36:05 PST 2008


Added eta.  Also alphabetized specs in signature.
----------------------------------------------------------------------

U   mltonlib/trunk/com/ssh/extended-basis/unstable/detail/fn/fn.sml
U   mltonlib/trunk/com/ssh/extended-basis/unstable/public/fn/fn.sig

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

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/fn/fn.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/fn/fn.sml	2008-01-09 17:03:42 UTC (rev 6305)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/fn/fn.sml	2008-01-09 17:36:04 UTC (rev 6306)
@@ -8,6 +8,7 @@
    open Fn
    fun const x _ = x
    fun curry f x y = f (x, y)
+   fun eta f x y = f x y
    fun fix f x = f (fix f) x
    fun flip f x y = f y x
    fun id x = x

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/public/fn/fn.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/public/fn/fn.sig	2008-01-09 17:03:42 UTC (rev 6305)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/public/fn/fn.sig	2008-01-09 17:36:04 UTC (rev 6306)
@@ -9,18 +9,21 @@
    type ('a, 'b) t = 'a -> 'b
    (** The type of functions. *)
 
-   val fix : ('a -> 'b) Fix.t
-   (** Fixpoint of given functional. *)
-
-   val map : ('c -> 'a) * ('b -> 'd) -> ('a -> 'b) -> 'c -> 'd
-   (** {map (f, g) h = g o h o f}. *)
-
    val const : 'a -> 'b -> 'a
    (** K-combinator ({const x y = x}). *)
 
    val curry : ('a * 'b -> 'c) -> 'a -> 'b -> 'c
    (** Currying ({curry f x y = f (x, y)}). *)
 
+   val eta : ('a -> 'b -> 'c) UnOp.t
+   (**
+    * {eta f x} is equivalent to {case (f, x) of (f, x) => fn y => f x y}.
+    * In other words, {eta} delays function application.
+    *)
+
+   val fix : ('a -> 'b) Fix.t
+   (** Fixpoint of given functional. *)
+
    val flip : ('a -> 'b -> 'c) -> 'b -> 'a -> 'c
    (** Flip the order of arguments ({flip f x y = f y x}). *)
 
@@ -30,8 +33,8 @@
    val iso : ('a, 'c) Iso.t * ('b, 'd) Iso.t -> (('a, 'b) t, ('c, 'd) t) Iso.t
    (** Lifts isos between elements to an iso between arrows. *)
 
-   val uncurry : ('a -> 'b -> 'c) -> 'a * 'b -> 'c
-   (** Uncurrying ({uncurry f (x, y) = f x y}). *)
+   val map : ('c -> 'a) * ('b -> 'd) -> ('a -> 'b) -> 'c -> 'd
+   (** {map (f, g) h = g o h o f}. *)
 
    val o : ('a -> 'b) * ('c -> 'a) -> 'c -> 'b
    (** Function composition ({(g o f) x = f (g x)}). *)
@@ -45,6 +48,9 @@
     * variables.
     *)
 
+   val uncurry : ('a -> 'b -> 'c) -> 'a * 'b -> 'c
+   (** Uncurrying ({uncurry f (x, y) = f x y}). *)
+
    val <\ : 'a * ('a * 'b -> 'c) -> 'b -> 'c
    (** Left section ({(x <\ f) y = f (x, y)}). *)
 




More information about the MLton-commit mailing list