Added an applyBottomUp function (non-monadic)
This commit is contained in:
parent
6a0529a9ce
commit
e78a30c231
|
@ -100,6 +100,13 @@ applyBottomUpM f = makeRecurseM ops
|
||||||
where
|
where
|
||||||
ops = baseOp `extOpM` makeBottomUpM ops f
|
ops = baseOp `extOpM` makeBottomUpM ops f
|
||||||
|
|
||||||
|
applyBottomUp :: (Polyplate t (OneOp s) (),
|
||||||
|
Polyplate s () (OneOp s)) =>
|
||||||
|
(s -> s) -> t -> t
|
||||||
|
applyBottomUp f = makeRecurse ops
|
||||||
|
where
|
||||||
|
ops = baseOp `extOp` makeBottomUp ops f
|
||||||
|
|
||||||
-- | Given a monadic function that applies to a particular type (s), automatically
|
-- | Given a monadic function that applies to a particular type (s), automatically
|
||||||
-- applies that function to every instance of s in a larger structure of type t,
|
-- applies that function to every instance of s in a larger structure of type t,
|
||||||
-- performing the transformations in a top-down fashion. It does a depth first
|
-- performing the transformations in a top-down fashion. It does a depth first
|
||||||
|
|
Loading…
Reference in New Issue
Block a user