diff --git a/frontends/RainTypes.hs b/frontends/RainTypes.hs index 29c0b4b..b80a22a 100644 --- a/frontends/RainTypes.hs +++ b/frontends/RainTypes.hs @@ -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