Added marking up of types in foreach replicators for type unification
This commit is contained in:
parent
0c443255e6
commit
760c8a9a1e
|
@ -96,7 +96,7 @@ performTypeUnification x
|
||||||
<.< markParamPass
|
<.< markParamPass
|
||||||
<.< markAssignmentTypes
|
<.< markAssignmentTypes
|
||||||
<.< markCommTypes
|
<.< markCommTypes
|
||||||
-- TODO mark up types in replicators
|
<.< markReplicators
|
||||||
<.< markExpressionTypes
|
<.< markExpressionTypes
|
||||||
$ x
|
$ x
|
||||||
-- Then, we do the unification:
|
-- Then, we do the unification:
|
||||||
|
@ -131,6 +131,13 @@ recordInfNameTypes = everywhereM (mkM recordInfNameTypes')
|
||||||
return input
|
return input
|
||||||
recordInfNameTypes' r = return r
|
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.
|
-- | Folds all constants.
|
||||||
constantFoldPass :: Data t => t -> PassM t
|
constantFoldPass :: Data t => t -> PassM t
|
||||||
constantFoldPass = applyDepthM doExpression
|
constantFoldPass = applyDepthM doExpression
|
||||||
|
|
Loading…
Reference in New Issue
Block a user