Added marking up of types in foreach replicators for type unification

This commit is contained in:
Neil Brown 2008-05-18 11:13:48 +00:00
parent 0c443255e6
commit 760c8a9a1e

View File

@ -96,7 +96,7 @@ performTypeUnification x
<.< markParamPass
<.< markAssignmentTypes
<.< markCommTypes
-- TODO mark up types in replicators
<.< markReplicators
<.< markExpressionTypes
$ x
-- Then, we do the unification:
@ -131,6 +131,13 @@ recordInfNameTypes = everywhereM (mkM recordInfNameTypes')
return input
recordInfNameTypes' r = return r
markReplicators :: Data t => t -> PassM t
markReplicators = checkDepthM mark
where
mark :: Check A.Replicator
mark (A.ForEach _m n e)
= astTypeOf n >>= \t -> markUnify (A.List t) e
-- | Folds all constants.
constantFoldPass :: Data t => t -> PassM t
constantFoldPass = applyDepthM doExpression