deep-transformations-0: Deep natural and unnatural tree transformations, including attribute grammars
Safe HaskellNone
LanguageHaskell2010

Transformation.AG

Synopsis

Documentation

type family Atts (f :: * -> *) a Source #

newtype Inherited t a Source #

Constructors

Inherited 

Fields

Instances

Instances details
Show (Atts (Inherited t) a) => Show (Inherited t a) Source # 
Instance details

Defined in Transformation.AG

Methods

showsPrec :: Int -> Inherited t a -> ShowS #

show :: Inherited t a -> String #

showList :: [Inherited t a] -> ShowS #

Transformation (Inherited t a) Source # 
Instance details

Defined in Transformation.AG

Associated Types

type Domain (Inherited t a) :: Type -> Type Source #

type Codomain (Inherited t a) :: Type -> Type Source #

Atts (Inherited t) a ~ Atts (Inherited t) b => At (Inherited t a) b Source # 
Instance details

Defined in Transformation.AG

Methods

($) :: Inherited t a -> Domain (Inherited t a) b -> Codomain (Inherited t a) b Source #

type Domain (Inherited t a) Source # 
Instance details

Defined in Transformation.AG

type Domain (Inherited t a) = Semantics t
type Codomain (Inherited t a) Source # 
Instance details

Defined in Transformation.AG

newtype Synthesized t a Source #

Constructors

Synthesized 

Fields

Instances

Instances details
Show (Atts (Synthesized t) a) => Show (Synthesized t a) Source # 
Instance details

Defined in Transformation.AG

Methods

showsPrec :: Int -> Synthesized t a -> ShowS #

show :: Synthesized t a -> String #

showList :: [Synthesized t a] -> ShowS #

type Rule t g = forall sem. sem ~ Semantics t => (Inherited t (g sem sem), g sem (Synthesized t)) -> (Synthesized t (g sem sem), g sem (Inherited t)) Source #

knit :: (Apply (g sem), sem ~ Semantics t) => Rule t g -> g sem sem -> sem (g sem sem) Source #

class Attribution t g deep shallow where Source #

Minimal complete definition

attribution | bequest, synthesis

Methods

attribution :: t -> shallow (g deep deep) -> Rule t g Source #

bequest :: forall sem. sem ~ Semantics t => t -> shallow (g deep deep) -> Atts (Inherited t) (g sem sem) -> g sem (Synthesized t) -> g sem (Inherited t) Source #

synthesis :: forall sem. sem ~ Semantics t => t -> shallow (g deep deep) -> Atts (Inherited t) (g sem sem) -> g sem (Synthesized t) -> Atts (Synthesized t) (g sem sem) Source #

passDown :: (sem ~ Semantics t, Functor (Inherited t (g sem sem)) (g sem)) => Inherited t (g sem sem) -> g sem sem -> g sem (Inherited t) Source #

applyDefault :: (q ~ Semantics t, x ~ g q q, Apply (g q), Attribution t g q p) => (forall a. p a -> a) -> t -> p x -> q x Source #

Drop-in implementation of $

fullMapDefault :: (p ~ Domain t, q ~ Semantics t, q ~ Codomain t, x ~ g q q, Apply (g q), Functor t g, Attribution t g p p) => (forall a. p a -> a) -> t -> p (g p p) -> q (g q q) Source #

Drop-in implementation of <$>