Copyright | (c) 2011 Patrick Bahr |
---|---|
License | BSD3 |
Maintainer | Patrick Bahr <[email protected]> |
Stability | experimental |
Portability | non-portable (GHC Extensions) |
Safe Haskell | None |
Language | Haskell2010 |
Data.Comp.Multi.Generic
Description
This module defines type generic functions and recursive schemes along the lines of the Uniplate library. All definitions are generalised versions of those in Data.Comp.Generic.
Synopsis
- subterms :: forall (f :: (Type -> Type) -> Type -> Type). HFoldable f => Term f :=> [E (Term f)]
- subterms' :: forall (f :: (Type -> Type) -> Type -> Type) (g :: (Type -> Type) -> Type -> Type). (HFoldable f, g :<: f) => Term f :=> [E (g (Term f))]
- transform :: forall (f :: (Type -> Type) -> Type -> Type). HFunctor f => (Term f :-> Term f) -> Term f :-> Term f
- transformM :: forall (f :: (Type -> Type) -> Type -> Type) (m :: Type -> Type). (HTraversable f, Monad m) => NatM m (Term f) (Term f) -> NatM m (Term f) (Term f)
- query :: forall (f :: (Type -> Type) -> Type -> Type) r. HFoldable f => (Term f :=> r) -> (r -> r -> r) -> Term f :=> r
- subs :: forall (f :: (Type -> Type) -> Type -> Type). HFoldable f => Term f :=> [E (Term f)]
- subs' :: forall (f :: (Type -> Type) -> Type -> Type) (g :: (Type -> Type) -> Type -> Type). (HFoldable f, g :<: f) => Term f :=> [E (g (Term f))]
- size :: forall (f :: (Type -> Type) -> Type -> Type) h (a :: Type -> Type). HFoldable f => Cxt h f a :=> Int
- depth :: forall (f :: (Type -> Type) -> Type -> Type) h (a :: Type -> Type). HFoldable f => Cxt h f a :=> Int
Documentation
subterms :: forall (f :: (Type -> Type) -> Type -> Type). HFoldable f => Term f :=> [E (Term f)] Source #
This function returns a list of all subterms of the given
term. This function is similar to Uniplate's universe
function.
subterms' :: forall (f :: (Type -> Type) -> Type -> Type) (g :: (Type -> Type) -> Type -> Type). (HFoldable f, g :<: f) => Term f :=> [E (g (Term f))] Source #
This function returns a list of all subterms of the given term that are constructed from a particular functor.
transform :: forall (f :: (Type -> Type) -> Type -> Type). HFunctor f => (Term f :-> Term f) -> Term f :-> Term f Source #
This function transforms every subterm according to the given
function in a bottom-up manner. This function is similar to
Uniplate's transform
function.
transformM :: forall (f :: (Type -> Type) -> Type -> Type) (m :: Type -> Type). (HTraversable f, Monad m) => NatM m (Term f) (Term f) -> NatM m (Term f) (Term f) Source #
Monadic version of transform
.
query :: forall (f :: (Type -> Type) -> Type -> Type) r. HFoldable f => (Term f :=> r) -> (r -> r -> r) -> Term f :=> r Source #
subs :: forall (f :: (Type -> Type) -> Type -> Type). HFoldable f => Term f :=> [E (Term f)] Source #
subs' :: forall (f :: (Type -> Type) -> Type -> Type) (g :: (Type -> Type) -> Type -> Type). (HFoldable f, g :<: f) => Term f :=> [E (g (Term f))] Source #