diff --git a/pass/Pass.hs b/pass/Pass.hs index d3b93fb..1cebbda 100644 --- a/pass/Pass.hs +++ b/pass/Pass.hs @@ -59,6 +59,12 @@ type PassType t = t -> PassM t type PassOnOps ops = (PolyplateM t ops () PassM, PolyplateM t () ops PassM) => Pass t +type CheckOnOps ops + = (PolyplateSpine t ops () (PassM ())) => Pass t + +type PlainCheckOnOps ops + = (PolyplateSpine t ops () (PassM ())) => t -> PassM () + type PassASTOnOps ops = (PolyplateM A.AST ops () PassM, PolyplateM A.AST () ops PassM) => Pass A.AST @@ -68,7 +74,8 @@ type PassTypeOnOps ops type PassOn t = PassOnOps (OneOpM PassM t) type PassOn2 s t = PassOnOps (TwoOpM PassM s t) type PassTypeOn t = PassTypeOnOps (OneOpM PassM t) - +type CheckOn t = CheckOnOps (OneOpQ (PassM ()) t) +type PlainCheckOn t = PlainCheckOnOps (OneOpQ (PassM ()) t) -- | A description of an AST-mangling pass. data Pass t = Pass { diff --git a/pass/Traversal.hs b/pass/Traversal.hs index 4aaa855..9d58b3c 100644 --- a/pass/Traversal.hs +++ b/pass/Traversal.hs @@ -21,7 +21,7 @@ with this program. If not, see . module Traversal ( TransformM, Transform, TransformStructured , CheckM, Check - , ExtOpMP, ExtOpMS, ExtOpMSP, extOpMS + , ExtOpMP, ExtOpMS, ExtOpMSP, extOpMS, PassOnStruct , applyBottomUpMS , module Data.Generics.Polyplate , module Data.Generics.Polyplate.Schemes @@ -35,7 +35,8 @@ import Data.Generics.Polyplate.Schemes import qualified AST as A import GenericUtils -import NavAST +import NavAST() +import NavASTSpine() import Pass -- | A transformation for a single 'Data' type. @@ -65,6 +66,8 @@ type ExtOpMS m opT = opT))))))) type ExtOpMSP opT = ExtOpMS PassM opT +type PassOnStruct = PassOnOps (ExtOpMSP BaseOp) + extOpMS :: forall m opT op0T. (PolyplateM (A.Structured ()) () op0T m, PolyplateM (A.Structured A.Alternative) () op0T m,