[MLton-commit] r6221
Matthew Fluet
fluet at mlton.org
Wed Nov 28 22:20:15 PST 2007
More types in trace output for CoreML.
----------------------------------------------------------------------
U mlton/trunk/mlton/core-ml/core-ml.fun
U mlton/trunk/mlton/core-ml/core-ml.sig
U mlton/trunk/mlton/elaborate/elaborate-core.fun
----------------------------------------------------------------------
Modified: mlton/trunk/mlton/core-ml/core-ml.fun
===================================================================
--- mlton/trunk/mlton/core-ml/core-ml.fun 2007-11-28 15:51:04 UTC (rev 6220)
+++ mlton/trunk/mlton/core-ml/core-ml.fun 2007-11-29 06:20:02 UTC (rev 6221)
@@ -300,6 +300,15 @@
maybeConstrain (Var.layout arg, argType),
str " =>"],
layoutExp body])
+
+ fun layoutExpWithType (exp as Exp {ty, ...}) =
+ let
+ val node = layoutExp exp
+ in
+ if !Control.showTypes
+ then seq [node, str " : ", Type.layout ty]
+ else node
+ end
end
structure Lambda =
@@ -327,6 +336,7 @@
datatype noMatch = datatype noMatch
val layout = layoutExp
+ val layoutWithType = layoutExpWithType
local
fun make f (Exp r) = f r
Modified: mlton/trunk/mlton/core-ml/core-ml.sig
===================================================================
--- mlton/trunk/mlton/core-ml/core-ml.sig 2007-11-28 15:51:04 UTC (rev 6220)
+++ mlton/trunk/mlton/core-ml/core-ml.sig 2007-11-29 06:20:02 UTC (rev 6221)
@@ -122,6 +122,7 @@
val isExpansive: t -> bool
val lambda: lambda -> t
val layout: t -> Layout.t
+ val layoutWithType: t -> Layout.t
val make: node * Type.t -> t
val node: t -> node
val orElse: t * t -> t
Modified: mlton/trunk/mlton/elaborate/elaborate-core.fun
===================================================================
--- mlton/trunk/mlton/elaborate/elaborate-core.fun 2007-11-28 15:51:04 UTC (rev 6220)
+++ mlton/trunk/mlton/elaborate/elaborate-core.fun 2007-11-29 06:20:02 UTC (rev 6221)
@@ -2312,7 +2312,7 @@
Trace.traceInfo
(elabExpInfo,
Layout.tuple3 (Aexp.layout, Nest.layout, Layout.ignore),
- Cexp.layout,
+ Cexp.layoutWithType,
Trace.assertTrue)
(fn (e: Aexp.t, nest, maybeName) =>
let
More information about the MLton-commit
mailing list