[MLton-commit] r6350
Vesa Karvonen
vesak at mlton.org
Thu Jan 24 04:51:35 PST 2008
Allow eta expansion of static sums.
----------------------------------------------------------------------
U mltonlib/trunk/com/ssh/extended-basis/unstable/detail/typing/static-sum.sml
U mltonlib/trunk/com/ssh/extended-basis/unstable/public/typing/static-sum.sig
----------------------------------------------------------------------
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/typing/static-sum.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/typing/static-sum.sml 2008-01-21 22:20:18 UTC (rev 6349)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/typing/static-sum.sml 2008-01-24 12:51:34 UTC (rev 6350)
@@ -5,11 +5,13 @@
*)
structure StaticSum :> STATIC_SUM = struct
- type ('a, 'b, 'c, 'd, 'e) t = ('a -> 'b) * ('c -> 'd) -> 'e
+ type ('dL, 'cL, 'dR, 'cR, 'c) dom = ('dL -> 'cL) * ('dR -> 'cR)
+ type ('dL, 'cL, 'dR, 'cR, 'c) cod = 'c
+ type ('dL, 'cL, 'dR, 'cR, 'c) t =
+ ('dL, 'cL, 'dR, 'cR, 'c) dom -> ('dL, 'cL, 'dR, 'cR, 'c) cod
fun inL a (a2b, _) = a2b a
fun inR c (_, c2d) = c2d c
fun match x = x
- fun split x = x (fn x => (inL x, inL x),
- fn x => (inR x, inR x))
+ fun split x = x (fn x => (inL x, inL x), fn x => (inR x, inR x))
fun out x = x (match, match)
end
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/public/typing/static-sum.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/public/typing/static-sum.sig 2008-01-21 22:20:18 UTC (rev 6349)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/public/typing/static-sum.sig 2008-01-24 12:51:34 UTC (rev 6350)
@@ -24,7 +24,10 @@
* The design is mostly copied from Stephen Weeks.
*)
signature STATIC_SUM = sig
- type ('l_dom, 'l_cod, 'r_dom, 'r_cod, 'result) t
+ type ('dL, 'cL, 'dR, 'cR, 'c) dom
+ type ('dL, 'cL, 'dR, 'cR, 'c) cod
+ type ('dL, 'cL, 'dR, 'cR, 'c) t =
+ ('dL, 'cL, 'dR, 'cR, 'c) dom -> ('dL, 'cL, 'dR, 'cR, 'c) cod
(** The type of static sums. *)
val inL : 'a -> ('a, 'b, 'c, 'd, 'b) t
More information about the MLton-commit
mailing list