Added a checkDepthM2 function to the Traversal module
This commit is contained in:
parent
875cf4b40a
commit
e72e95625a
|
@ -22,7 +22,7 @@ module Traversal (
|
||||||
, transformToExplicitDepth, checkToTransform
|
, transformToExplicitDepth, checkToTransform
|
||||||
, baseX, extX, extD, extC, applyX
|
, baseX, extX, extD, extC, applyX
|
||||||
, applyDepthM, applyDepthM2
|
, applyDepthM, applyDepthM2
|
||||||
, checkDepthM
|
, checkDepthM, checkDepthM2
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import Data.Generics
|
import Data.Generics
|
||||||
|
@ -107,3 +107,9 @@ checkDepthM :: forall t1 s. (Data t1, Data s) =>
|
||||||
checkDepthM f1
|
checkDepthM f1
|
||||||
= applyX $ baseX `extC` f1
|
= applyX $ baseX `extC` f1
|
||||||
|
|
||||||
|
-- | Apply two checks, recursing depth-first.
|
||||||
|
checkDepthM2 :: forall t1 t2 s. (Data t1, Data t2, Data s) =>
|
||||||
|
Check t1 -> Check t2 -> s -> PassM s
|
||||||
|
checkDepthM2 f1 f2
|
||||||
|
= applyX $ baseX `extC` f1 `extC` f2
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user