[MLton-commit] r6415
Vesa Karvonen
vesak at mlton.org
Tue Feb 26 03:09:21 PST 2008
Added isDegenerate.
----------------------------------------------------------------------
U mltonlib/trunk/com/ssh/generic/unstable/detail/value/type-info.sml
U mltonlib/trunk/com/ssh/generic/unstable/public/value/type-info.sig
----------------------------------------------------------------------
Modified: mltonlib/trunk/com/ssh/generic/unstable/detail/value/type-info.sml
===================================================================
--- mltonlib/trunk/com/ssh/generic/unstable/detail/value/type-info.sml 2008-02-23 12:32:18 UTC (rev 6414)
+++ mltonlib/trunk/com/ssh/generic/unstable/detail/value/type-info.sml 2008-02-26 11:09:20 UTC (rev 6415)
@@ -26,9 +26,12 @@
open TypeInfoRep.This
+ fun outT (INT r) = r
fun outS (INS r) = r
fun outP (INP r) = r
+ fun isDegenerate ? = (not o #base o outT o getT) ?
+
fun hasBaseCase ? = (#base o outS o getS) ?
fun numAlts ? = (#alts o outS o getS) ?
Modified: mltonlib/trunk/com/ssh/generic/unstable/public/value/type-info.sig
===================================================================
--- mltonlib/trunk/com/ssh/generic/unstable/public/value/type-info.sig 2008-02-23 12:32:18 UTC (rev 6414)
+++ mltonlib/trunk/com/ssh/generic/unstable/public/value/type-info.sig 2008-02-26 11:09:20 UTC (rev 6415)
@@ -20,6 +20,14 @@
signature TYPE_INFO = sig
structure TypeInfoRep : OPEN_REP
+ (** == Complete Types == *)
+
+ val isDegenerate : ('a, 'x) TypeInfoRep.t UnPr.t
+ (**
+ * Returns true iff the type {'a} is recursive and has no non-recursive
+ * variants. This means that values of the type cannot be created.
+ *)
+
(** == Sums == *)
val hasBaseCase : ('a, 'x) TypeInfoRep.s UnPr.t
More information about the MLton-commit
mailing list