{-# LANGUAGE MultiParamTypeClasses #-}
module Data.Generics.Biplate
(
module Data.Generics.UniplateStrOn,
module Data.Generics.Biplate
) where
import Data.Generics.UniplateStrOn
class Uniplate to => Biplate from to where
biplate :: BiplateType from to
biplateList :: Biplate from to => from -> ([to], [to] -> from)
biplateList :: from -> ([to], [to] -> from)
biplateList from
x = ([to]
c, Str to -> from
b (Str to -> from) -> ([to] -> Str to) -> [to] -> from
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [to] -> Str to
d)
where
(Str to
a,Str to -> from
b) = BiplateType from to
forall from to. Biplate from to => BiplateType from to
biplate from
x
([to]
c,[to] -> Str to
d) = Str to -> ([to], [to] -> Str to)
forall a. Str a -> ([a], [a] -> Str a)
strStructure Str to
a
universeBi :: Biplate from to => from -> [to]
universeBi :: from -> [to]
universeBi = BiplateType from to -> from -> [to]
forall to from. Uniplate to => BiplateType from to -> from -> [to]
universeOn BiplateType from to
forall from to. Biplate from to => BiplateType from to
biplate
childrenBi :: Biplate from to => from -> [to]
childrenBi :: from -> [to]
childrenBi = BiplateType from to -> from -> [to]
forall to from. Uniplate to => BiplateType from to -> from -> [to]
childrenOn BiplateType from to
forall from to. Biplate from to => BiplateType from to
biplate
transformBi :: Biplate from to => (to -> to) -> from -> from
transformBi :: (to -> to) -> from -> from
transformBi = BiplateType from to -> (to -> to) -> from -> from
forall to from.
Uniplate to =>
BiplateType from to -> (to -> to) -> from -> from
transformOn BiplateType from to
forall from to. Biplate from to => BiplateType from to
biplate
transformBiM :: (Monad m, Biplate from to) => (to -> m to) -> from -> m from
transformBiM :: (to -> m to) -> from -> m from
transformBiM = BiplateType from to -> (to -> m to) -> from -> m from
forall (m :: * -> *) to from.
(Monad m, Uniplate to) =>
BiplateType from to -> (to -> m to) -> from -> m from
transformOnM BiplateType from to
forall from to. Biplate from to => BiplateType from to
biplate
rewriteBi :: Biplate from to => (to -> Maybe to) -> from -> from
rewriteBi :: (to -> Maybe to) -> from -> from
rewriteBi = BiplateType from to -> (to -> Maybe to) -> from -> from
forall to from.
Uniplate to =>
BiplateType from to -> (to -> Maybe to) -> from -> from
rewriteOn BiplateType from to
forall from to. Biplate from to => BiplateType from to
biplate
rewriteBiM :: (Monad m, Biplate from to) => (to -> m (Maybe to)) -> from -> m from
rewriteBiM :: (to -> m (Maybe to)) -> from -> m from
rewriteBiM = BiplateType from to -> (to -> m (Maybe to)) -> from -> m from
forall (m :: * -> *) to from.
(Monad m, Uniplate to) =>
BiplateType from to -> (to -> m (Maybe to)) -> from -> m from
rewriteOnM BiplateType from to
forall from to. Biplate from to => BiplateType from to
biplate
descendBi :: Biplate from to => (to -> to) -> from -> from
descendBi :: (to -> to) -> from -> from
descendBi = BiplateType from to -> (to -> to) -> from -> from
forall to from.
Uniplate to =>
BiplateType from to -> (to -> to) -> from -> from
descendOn BiplateType from to
forall from to. Biplate from to => BiplateType from to
biplate
descendBiM :: (Monad m, Biplate from to) => (to -> m to) -> from -> m from
descendBiM :: (to -> m to) -> from -> m from
descendBiM = BiplateType from to -> (to -> m to) -> from -> m from
forall (m :: * -> *) to from.
(Monad m, Uniplate to) =>
BiplateType from to -> (to -> m to) -> from -> m from
descendOnM BiplateType from to
forall from to. Biplate from to => BiplateType from to
biplate
contextsBi:: Biplate from to => from -> [(to, to -> from)]
contextsBi :: from -> [(to, to -> from)]
contextsBi = BiplateType from to -> from -> [(to, to -> from)]
forall to from.
Uniplate to =>
BiplateType from to -> from -> [(to, to -> from)]
contextsOn BiplateType from to
forall from to. Biplate from to => BiplateType from to
biplate
holesBi:: Biplate from to => from -> [(to, to -> from)]
holesBi :: from -> [(to, to -> from)]
holesBi = BiplateType from to -> from -> [(to, to -> from)]
forall to from.
Uniplate to =>
BiplateType from to -> from -> [(to, to -> from)]
holesOn BiplateType from to
forall from to. Biplate from to => BiplateType from to
biplate