Added some more type synonyms for checks and passes

This commit is contained in:
Neil Brown 2008-12-14 18:27:51 +00:00
parent 560b67de5e
commit 954664d238
2 changed files with 13 additions and 3 deletions

View File

@ -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 {

View File

@ -21,7 +21,7 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
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,