[MLton-commit] r6659
Vesa Karvonen
vesak at mlton.org
Sun Jun 29 02:08:25 PDT 2008
Shorthands for Types with an Isomorphism.
----------------------------------------------------------------------
U mltonlib/trunk/com/ssh/generic/unstable/detail/extra/with-extra.fun
U mltonlib/trunk/com/ssh/generic/unstable/public/extra/generic-extra.sig
----------------------------------------------------------------------
Modified: mltonlib/trunk/com/ssh/generic/unstable/detail/extra/with-extra.fun
===================================================================
--- mltonlib/trunk/com/ssh/generic/unstable/detail/extra/with-extra.fun 2008-06-15 23:51:35 UTC (rev 6658)
+++ mltonlib/trunk/com/ssh/generic/unstable/detail/extra/with-extra.fun 2008-06-29 09:08:23 UTC (rev 6659)
@@ -1,4 +1,5 @@
(* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland
+ * Copyright (C) 2008 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.
@@ -19,6 +20,10 @@
fun C1' n = C1 (C n)
fun R' n = R (L n)
+ fun data' s = iso (data s)
+ fun record' p = iso (record p)
+ fun tuple' p = iso (tuple p)
+
local
fun lift f a = SOME (f a) handle Match => NONE
in
Modified: mltonlib/trunk/com/ssh/generic/unstable/public/extra/generic-extra.sig
===================================================================
--- mltonlib/trunk/com/ssh/generic/unstable/public/extra/generic-extra.sig 2008-06-15 23:51:35 UTC (rev 6658)
+++ mltonlib/trunk/com/ssh/generic/unstable/public/extra/generic-extra.sig 2008-06-29 09:08:23 UTC (rev 6659)
@@ -1,4 +1,5 @@
(* Copyright (C) 2007-2008 SSH Communications Security, Helsinki, Finland
+ * Copyright (C) 2008 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.
@@ -8,10 +9,7 @@
* Signature for frequently used derived type representations.
*)
signature GENERIC_EXTRA = sig
- include GENERICS
- where type Label.t = Generics.Label.t
- where type Con.t = Generics.Con.t
- include GENERIC
+ include GENERICS GENERIC
(** == Shorthands for Types with Labels or Constructors ==
*
@@ -27,6 +25,12 @@
val regExn1' : String.t -> ('a, 'x) Open.Rep.t
-> ('a -> Exn.t) -> (Exn.t -> 'a) Effect.t
+ (** == Shorthands for Types with an Isomorphism == *)
+
+ val data' : ('b, 'y) Open.Rep.s -> ('a, 'b) Iso.t -> 'a Rep.t
+ val record' : ('b, Record.t, 'y) Open.Rep.p -> ('a, 'b) Iso.t -> 'a Rep.t
+ val tuple' : ('b, Tuple.t, 'y) Open.Rep.p -> ('a, 'b) Iso.t -> 'a Rep.t
+
(** == Tuples ==
*
* Note that these are provided for convenience --- generics are not
More information about the MLton-commit
mailing list