AspectAG-0.7.0.1: Strongly typed Attribute Grammars implemented using type-level programming.
Copyright(c) Juan García-Garland Marcos Viera 2019 2020
LicenseGPL
Maintainerjpgarcia@fing.edu.uy
Stabilityexperimental
PortabilityPOSIX
Safe HaskellNone
LanguageHaskell2010

Language.Grammars.AspectAG

Description

 
Synopsis

Rules

type Rule (prd :: Prod) (sc :: [(Child, [(Att, Type)])]) (ip :: [(Att, Type)]) (ic :: [(Child, [(Att, Type)])]) (sp :: [(Att, Type)]) (ic' :: [(Child, [(Att, Type)])]) (sp' :: [(Att, Type)]) = Fam prd sc ip -> Fam prd ic sp -> Fam prd ic' sp' Source #

Rules are a function from the input family to the output family, with an extra arity to make them composable. They are indexed by a production.

newtype CRule (ctx :: [ErrorMessage]) prd sc ip ic sp ic' sp' Source #

Rules with context (used to print domain specific type errors).

Constructors

CRule 

Fields

data Fam (prd :: Prod) (c :: [(Child, [(Att, Type)])]) (p :: [(Att, Type)]) :: Type Source #

In each node of the grammar, the Fam contains a single attribution for the parent, and a collection (Record) of attributions for the children:

chi :: Fam prd c p -> ChAttsRec prd c Source #

getter

par :: Fam prd c p -> Attribution p Source #

getter

Defining Rules

syndef :: Syndef t t' ctx att sp sp' prd prd' => forall sc ip ic. Label ('Att att t) -> Label prd -> (Proxy ctx -> Fam prd' sc ip -> t') -> CRule ctx prd sc ip ic sp ic sp' Source #

The function syndef adds the definition of a synthesized attribute. It takes an attribute label att representing the name of the new attribute; a production label prd representing the production where the rule is defined; a value t' to be assigned to this attribute, given a context and an input family. It updates the output constructed thus far.

syndefM :: Syndef t t' (MkMsg SyndefMsg att t prd nt ': ctx) att sp sp' prd prd' => Label ('Att att t) -> Label ('Prd prd nt) -> Reader (Proxy (MkMsg SyndefMsg att t prd nt ': ctx), Fam ('Prd prd' nt) sc ip) t' -> CRule ctx ('Prd prd nt) sc ip ic sp ic sp' Source #

syn :: Syndef t t' (MkMsg SyndefMsg att t prd nt ': ctx) att sp sp' prd prd' => Label ('Att att t) -> Label ('Prd prd nt) -> Reader (Proxy (MkMsg SyndefMsg att t prd nt ': ctx), Fam ('Prd prd' nt) sc ip) t' -> CRule ctx ('Prd prd nt) sc ip ic sp ic sp' Source #

This is simply an alias for syndef

synmod :: RequireR (OpUpdate AttReco ('Att att t) t r) ctx (Attribution sp') => Label ('Att att t) -> Label prd -> (Proxy ((((('Text "synmod(" :<>: ShowTE ('Att att t)) :<>: Text ", ") :<>: ShowTE prd) :<>: Text ")") ': ctx) -> Fam prd sc ip -> t) -> CRule ctx prd sc ip ic' r ic' sp' Source #

synthesized poly rule synP (att :: forall v. Label ('Att k v)) prd rul = (p :: Proxy p) -> syndefM (att @ p) prd rul

This is simply an alias for inhdefM inh = inhdefM

synmodM :: RequireR (OpUpdate AttReco ('Att att t) t r) ctx (Attribution sp') => Label ('Att att t) -> Label prd -> Reader (Proxy ((((('Text "synmod(" :<>: ShowTE ('Att att t)) :<>: Text ", ") :<>: ShowTE prd) :<>: Text ")") ': ctx), Fam prd sc ip) t -> CRule ctx prd sc ip ic' r ic' sp' Source #

inh :: Inhdef t t' (MkMsg InhdefMsg att t prd nt ': ctx) att r v2 prd prd' nt nt' chi ntch ic ic' n => Label ('Att att t) -> Label ('Prd prd nt) -> Label ('Chi chi ('Prd prd' nt') ntch) -> Reader (Proxy (MkMsg InhdefMsg att t prd nt ': ctx), Fam ('Prd prd nt) sc ip) t' -> CRule ctx ('Prd prd nt) sc ip ic sp ic' sp Source #

inhdef :: Inhdef t t' ctx att r v2 prd prd' nt nt' chi ntch ic ic' n => Label ('Att att t) -> Label ('Prd prd nt) -> Label ('Chi chi ('Prd prd' nt') ntch) -> (Proxy ctx -> Fam ('Prd prd nt) sc ip -> t') -> forall sp. CRule ctx ('Prd prd nt) sc ip ic sp ic' sp Source #

inhdefM :: Inhdef t t' (MkMsg InhdefMsg att t prd nt ': ctx) att r v2 prd prd' nt nt' chi ntch ic ic' n => Label ('Att att t) -> Label ('Prd prd nt) -> Label ('Chi chi ('Prd prd' nt') ntch) -> Reader (Proxy (MkMsg InhdefMsg att t prd nt ': ctx), Fam ('Prd prd nt) sc ip) t' -> CRule ctx ('Prd prd nt) sc ip ic sp ic' sp Source #

inhmod :: (RequireEq t t' ctx', RequireR (OpUpdate AttReco ('Att att t) t' r) ctx (Attribution v2), RequireR (OpUpdate (ChiReco ('Prd prd nt)) ('Chi chi ('Prd prd nt) ntch) v2 ic) ctx (ChAttsRec ('Prd prd nt) ic'), RequireR (OpLookup (ChiReco ('Prd prd nt)) ('Chi chi ('Prd prd nt) ntch) ic) ctx (Attribution r), ntch ~ 'Left n, ctx' ~ (((((((Text "inhmod(" :<>: ShowTE ('Att att t)) :<>: Text ", ") :<>: ShowTE ('Prd prd nt)) :<>: Text ", ") :<>: ShowTE ('Chi chi ('Prd prd nt) ntch)) :<>: Text ")") ': ctx)) => Label ('Att att t) -> Label ('Prd prd nt) -> Label ('Chi chi ('Prd prd nt) ntch) -> (Proxy ctx' -> Fam ('Prd prd nt) sc ip -> t') -> CRule ctx ('Prd prd nt) sc ip ic sp ic' sp Source #

inhmodM :: (RequireEq t t' ctx', RequireR (OpUpdate AttReco ('Att att t) t' r) ctx (Attribution v2), RequireR (OpUpdate (ChiReco ('Prd prd nt)) ('Chi chi ('Prd prd nt) ntch) v2 ic) ctx (ChAttsRec ('Prd prd nt) ic'), RequireR (OpLookup (ChiReco ('Prd prd nt)) ('Chi chi ('Prd prd nt) ntch) ic) ctx (Attribution r), ntch ~ 'Left n, ctx' ~ (((((((Text "inhmod(" :<>: ShowTE ('Att att t)) :<>: Text ", ") :<>: ShowTE ('Prd prd nt)) :<>: Text ", ") :<>: ShowTE ('Chi chi ('Prd prd nt) ntch)) :<>: Text ")") ': ctx)) => Label ('Att att t) -> Label ('Prd prd nt) -> Label ('Chi chi ('Prd prd nt) ntch) -> Reader (Proxy ctx', Fam ('Prd prd nt) sc ip) t' -> CRule ctx ('Prd prd nt) sc ip ic sp ic' sp Source #

emptyRule :: forall (ctx :: [ErrorMessage]) (prd :: Prod) (sc :: [(Child, [(Att, Type)])]) (ip :: [(Att, Type)]) (ic' :: [(Child, [(Att, Type)])]) (sp' :: [(Att, Type)]). CRule ctx prd sc ip ic' sp' ic' sp' Source #

emptyRuleAtPrd :: Label prd -> CRule ctx prd sc ip ic' sp' ic' sp' Source #

emptyRuleInst :: KList sc -> CRule ctx prd sc ip ic sp ic sp Source #

ext :: RequireEq prd prd' (Text "ext" ': ctx) => CRule ctx prd sc ip ic sp ic' sp' -> CRule ctx prd' sc ip a b ic sp -> CRule ctx prd sc ip a b ic' sp' Source #

Given two rules for a given (the same) production, it combines them. Note that the production equality is visible in the context, not sintactically. This is a use of the Require pattern.

(.+.) :: forall (ctx :: [ErrorMessage]) (prd' :: Prod) (sc :: [(Child, [(Att, Type)])]) (ip :: [(Att, Type)]) (ic :: [(Child, [(Att, Type)])]) (sp :: [(Att, Type)]) (ic' :: [(Child, [(Att, Type)])]) (sp' :: [(Att, Type)]) (a :: [(Child, [(Att, Type)])]) (b :: [(Att, Type)]). CRule ctx prd' sc ip ic sp ic' sp' -> CRule ctx prd' sc ip a b ic sp -> CRule ctx prd' sc ip a b ic' sp' infixr 6 Source #

extP :: forall k (p :: k) (ctx :: [ErrorMessage]) (prd' :: Prod) (sc :: [(Child, [(Att, Type)])]) (ip :: [(Att, Type)]) (ic :: [(Child, [(Att, Type)])]) (sp :: [(Att, Type)]) (ic' :: [(Child, [(Att, Type)])]) (sp' :: [(Att, Type)]) (a :: [(Child, [(Att, Type)])]) (b :: [(Att, Type)]). (Proxy p -> CRule ctx prd' sc ip ic sp ic' sp') -> (Proxy p -> CRule ctx prd' sc ip a b ic sp) -> Proxy p -> CRule ctx prd' sc ip a b ic' sp' Source #

extension of polymorphic rules

Aspects

Building Aspects.

emptyAspect :: CAspect ctx '[] Source #

Recall that Aspects are mappings from productions to rules. They have a record-like interface to build them. This is the constructor for the empty Aspect.

singAsp :: forall (ctx :: [ErrorMessage]) (prd :: Prod) (sc :: [(Child, [(Att, Type)])]) (ip :: [(Att, Type)]) (ic :: [(Child, [(Att, Type)])]) (sp :: [(Att, Type)]) (ic' :: [(Child, [(Att, Type)])]) (sp' :: [(Att, Type)]). CRule ctx prd sc ip ic sp ic' sp' -> CAspect ctx '['(prd, CRule ctx prd sc ip ic sp ic' sp')] Source #

Singleton Aspect. Wraps a rule to build an Aspect from it.

extAspect :: ExtAspect ctx prd sc ip ic sp ic' sp' a asp => CRule ctx prd sc ip ic sp ic' sp' -> CAspect ctx a -> CAspect ctx asp Source #

The "cons" for CAspects. It adds a Rule rule to a CAspect. If there is no rule for that production in the argument it is a record extension. If the production is there, the rules are combined.

comAspect :: (Require (OpComAsp al ar) ctx, ReqR (OpComAsp al ar) ~ Aspect asp) => CAspect ctx al -> CAspect ctx ar -> CAspect ctx asp Source #

combination of two Aspects. It merges them. When both aspects have rules for a given production, in the resulting Aspect the rule at that field is the combination of the rules for the arguments (with ext).

(.+:) :: forall (ctx :: [ErrorMessage]) (prd :: Prod) (sc :: [(Child, [(Att, Type)])]) (ip :: [(Att, Type)]) (ic :: [(Child, [(Att, Type)])]) (sp :: [(Att, Type)]) (ic' :: [(Child, [(Att, Type)])]) (sp' :: [(Att, Type)]) (a :: [(Prod, Type)]) (asp :: [(Prod, Type)]). (Require (OpComRA ctx prd (CRule ctx prd sc ip ic sp ic' sp') a) ctx, ReqR (OpComRA ctx prd (CRule ctx prd sc ip ic sp ic' sp') a) ~ Rec PrdReco asp) => CRule ctx prd sc ip ic sp ic' sp' -> CAspect ctx a -> CAspect ctx asp infixr 3 Source #

An operator, alias for extAspect. It combines a rule with an aspect, to build a bigger one.

(◃) :: forall (ctx :: [ErrorMessage]) (prd :: Prod) (sc :: [(Child, [(Att, Type)])]) (ip :: [(Att, Type)]) (ic :: [(Child, [(Att, Type)])]) (sp :: [(Att, Type)]) (ic' :: [(Child, [(Att, Type)])]) (sp' :: [(Att, Type)]) (a :: [(Prod, Type)]) (asp :: [(Prod, Type)]). (Require (OpComRA ctx prd (CRule ctx prd sc ip ic sp ic' sp') a) ctx, ReqR (OpComRA ctx prd (CRule ctx prd sc ip ic sp ic' sp') a) ~ Rec PrdReco asp) => CRule ctx prd sc ip ic sp ic' sp' -> CAspect ctx a -> CAspect ctx asp infixr 3 Source #

Unicode version of extAspect or .+: (\triangleleft)

(.:+.) :: forall (ctx :: [ErrorMessage]) (prd :: Prod) (sc :: [(Child, [(Att, Type)])]) (ip :: [(Att, Type)]) (ic :: [(Child, [(Att, Type)])]) (sp :: [(Att, Type)]) (ic' :: [(Child, [(Att, Type)])]) (sp' :: [(Att, Type)]) (a :: [(Prod, Type)]) (asp :: [(Prod, Type)]). (Require (OpComRA ctx prd (CRule ctx prd sc ip ic sp ic' sp') a) ctx, ReqR (OpComRA ctx prd (CRule ctx prd sc ip ic sp ic' sp') a) ~ Rec PrdReco asp) => CAspect ctx a -> CRule ctx prd sc ip ic sp ic' sp' -> CAspect ctx asp infixl 3 Source #

The other way, combines an aspect with a rule. It is a flipped extAspect.

(▹) :: forall (ctx :: [ErrorMessage]) (prd :: Prod) (sc :: [(Child, [(Att, Type)])]) (ip :: [(Att, Type)]) (ic :: [(Child, [(Att, Type)])]) (sp :: [(Att, Type)]) (ic' :: [(Child, [(Att, Type)])]) (sp' :: [(Att, Type)]) (a :: [(Prod, Type)]) (asp :: [(Prod, Type)]). (Require (OpComRA ctx prd (CRule ctx prd sc ip ic sp ic' sp') a) ctx, ReqR (OpComRA ctx prd (CRule ctx prd sc ip ic sp ic' sp') a) ~ Rec PrdReco asp) => CAspect ctx a -> CRule ctx prd sc ip ic sp ic' sp' -> CAspect ctx asp infixl 3 Source #

Unicode operator for .:+. or `flip extAspect`.

(.:+:) :: forall (al :: [(Prod, Type)]) (ar :: [(Prod, Type)]) (ctx :: [ErrorMessage]) (asp :: [(Prod, Type)]). (Require (OpComAsp al ar) ctx, ReqR (OpComAsp al ar) ~ Aspect asp) => CAspect ctx al -> CAspect ctx ar -> CAspect ctx asp infixr 4 Source #

Operator for comAspect. It takes two CAspects to build the combination of both.

(⋈) :: forall (al :: [(Prod, Type)]) (ar :: [(Prod, Type)]) (ctx :: [ErrorMessage]) (asp :: [(Prod, Type)]). (Require (OpComAsp al ar) ctx, ReqR (OpComAsp al ar) ~ Aspect asp) => CAspect ctx al -> CAspect ctx ar -> CAspect ctx asp infixr 4 Source #

Unicode operator for comAspect or .:+:. (\bowtie)

(.#..) :: forall (l :: Prod) (r :: [(Prod, Type)]) (ctx1 :: [ErrorMessage]) (ctx2 :: [ErrorMessage]). Require (OpLookup PrdReco l r) ('ShowType r ': ctx1) => CAspect ctx2 r -> Label l -> ReqR (OpLookup PrdReco l r) Source #

newtype CAspect (ctx :: [ErrorMessage]) (asp :: [(Prod, Type)]) Source #

Aspects, tagged with context. Aspect is a record instance having productions as labels, containing Rules as fields.

Constructors

CAspect 

Fields

data Label (l :: k) #

Constructors

Label 

data Prod Source #

Constructors

Prd Symbol NT 

Instances

Instances details
OrdType Prod Source # 
Instance details

Defined in Language.Grammars.AspectAG.RecordInstances

Associated Types

type Cmp a b :: Ordering #

type ShowTE ('Prd l nt :: Prod) Source # 
Instance details

Defined in Language.Grammars.AspectAG.RecordInstances

type ShowTE ('Prd l nt :: Prod) = 'Text (AppendSymbol (AppendSymbol (AppendSymbol (AppendSymbol "(" l) " of ") (FromEM (ShowTE nt))) ")")
type Cmp ('Prd a _1 :: Prod) ('Prd b _2 :: Prod) Source # 
Instance details

Defined in Language.Grammars.AspectAG.RecordInstances

type Cmp ('Prd a _1 :: Prod) ('Prd b _2 :: Prod) = CmpSymbol a b

data T Source #

Constructors

T Type 

Instances

Instances details
type ShowTE ('T l :: T) Source # 
Instance details

Defined in Language.Grammars.AspectAG.RecordInstances

type ShowTE ('T l :: T) = 'Text (AppendSymbol "Terminal " (FromEM (ShowTE l)))

data NT Source #

Constructors

NT Symbol 

Instances

Instances details
type ShowTE ('NT l :: NT) Source # 
Instance details

Defined in Language.Grammars.AspectAG.RecordInstances

type ShowTE ('NT l :: NT) = 'Text (AppendSymbol "Non-Terminal " l)

data Child Source #

Constructors

Chi Symbol Prod (Either NT T) 

Instances

Instances details
OrdType Child Source # 
Instance details

Defined in Language.Grammars.AspectAG.RecordInstances

Associated Types

type Cmp a b :: Ordering #

type ShowTE ('Chi l p s :: Child) Source # 
Instance details

Defined in Language.Grammars.AspectAG.RecordInstances

type ShowTE ('Chi l p s :: Child) = 'Text (AppendSymbol (AppendSymbol (AppendSymbol "Child " l) " of producion ") (FromEM (ShowTE p)))
type Cmp ('Chi a _1 _2 :: Child) ('Chi b _3 _4 :: Child) Source # 
Instance details

Defined in Language.Grammars.AspectAG.RecordInstances

type Cmp ('Chi a _1 _2 :: Child) ('Chi b _3 _4 :: Child) = CmpSymbol a b

data Att Source #

Constructors

Att Symbol Type 

Instances

Instances details
OrdType Att Source # 
Instance details

Defined in Language.Grammars.AspectAG.RecordInstances

Associated Types

type Cmp a b :: Ordering #

type UnWrap (Attribution r) Source # 
Instance details

Defined in Language.Grammars.AspectAG

type UnWrap (Attribution r) = r
type UnWrap (Rec c r) Source # 
Instance details

Defined in Language.Grammars.AspectAG

type UnWrap (Rec c r) = r
type ShowTE ('Att l t :: Att) Source # 
Instance details

Defined in Language.Grammars.AspectAG.RecordInstances

type ShowTE ('Att l t :: Att) = 'Text (AppendSymbol (AppendSymbol (AppendSymbol (AppendSymbol "(" l) ":") (FromEM (ShowTE t))) ")")
type Cmp ('Att a _1 :: Att) ('Att b _2 :: Att) Source # 
Instance details

Defined in Language.Grammars.AspectAG.RecordInstances

type Cmp ('Att a _1 :: Att) ('Att b _2 :: Att) = CmpSymbol a b
type WrapField (ChiReco prd :: Type) (v :: [(Att, Type)]) Source #

Field type

Instance details

Defined in Language.Grammars.AspectAG.RecordInstances

type WrapField (ChiReco prd :: Type) (v :: [(Att, Type)]) = Attribution v

(.#) :: (c ~ 'Chi ch prd nt, ctx ~ '[((Text "looking up " :<>: ShowTE c) :$$: (Text "on " :<>: ShowTE r)) :$$: (Text "producion: " :<>: ShowTE prd)], Require (OpLookup (ChiReco prd) c r) ctx) => Rec (ChiReco prd) r -> Label c -> ReqR (OpLookup (ChiReco prd) c r) infixl 8 Source #

(#.) :: (msg ~ '[(Text "looking up attribute " :<>: ShowTE l) :$$: (Text "on " :<>: ShowTE r)], Require (OpLookup AttReco l r) msg) => Attribution r -> Label l -> ReqR (OpLookup AttReco l r) infixl 7 Source #

(=.) :: Label l -> v -> Attribute l v infixr 4 Source #

Apretty constructor for an attribute

(.=) :: Label l -> WrapField (ChiReco prd) v -> TaggedChAttr prd l v infixr 4 Source #

Pretty constructor for tagging a child

(.*) :: forall (prd :: Prod) (ch :: Child) (attrib :: [(Att, Type)]) (attribs :: [(Child, [(Att, Type)])]). Require (OpExtend (ChiReco prd) ch attrib attribs) '['Text ""] => TaggedChAttr prd ch attrib -> ChAttsRec prd attribs -> ReqR (OpExtend (ChiReco prd) ch attrib attribs) infixr 2 Source #

Pretty constructors

(*.) :: forall (att :: Att) val (atts :: [(Att, Type)]). Require (OpExtend AttReco att val atts) '['Text ""] => Attribute att val -> Attribution atts -> ReqR (OpExtend AttReco att val atts) infixr 2 Source #

Extending

ter :: (RequireR (OpLookup (ChiReco prd) pos chi) ctx (Attribution r), RequireR (OpLookup AttReco ('Att "term" t) r) ctx t, RequireEqWithMsg prd prd' PrdTypeMatch ctx, ReqR (OpLookup AttReco ('Att "term" t) (UnWrap @Att @Type (Attribution r))) ~ t, RequireEq pos ('Chi ch prd rtt) ctx, RequireEq rtt (Right ('T t)) ctx) => Label pos -> Reader (Proxy ctx, Fam prd' chi par) t Source #

at :: At pos att m => Label pos -> Label att -> m (ResAt pos att m) Source #

lhs :: Label Lhs Source #

sem_Lit :: SemLit a => a -> Attribution ('[] :: [(Att, Type)]) -> Attribution '['('Att "term" a, a)] Source #

knitAspect :: forall (fc :: [(Child, Type)]) (prd1 :: Prod) (prd2 :: Prod) (r :: [(Prod, Type)]) (ip :: [(Att, Type)]) (sp :: [(Att, Type)]). (Empties fc prd1, Kn fc prd1, Require (OpLookup PrdReco prd2 r) '['Text (AppendSymbol "knit:" (FromEM (ShowTE prd2)))], ReqR (OpLookup PrdReco prd2 r) ~ CRule ('[] :: [ErrorMessage]) prd1 (SCh fc) ip (EmptiesR fc) ('[] :: [(Att, Type)]) (ICh fc) sp) => Label prd2 -> CAspect ('[] :: [ErrorMessage]) r -> Record fc -> Attribution ip -> Attribution sp Source #

knit :: forall (fc :: [(Child, Type)]) (prd :: Prod) (ctx :: [ErrorMessage]) (ip :: [(Att, Type)]) (sp :: [(Att, Type)]). (Empties fc prd, Kn fc prd) => Proxy ctx -> CRule ctx prd (SCh fc) ip (EmptiesR fc) ('[] :: [(Att, Type)]) (ICh fc) sp -> Record fc -> Attribution ip -> Attribution sp Source #

traceAspect :: forall (r :: [(Prod, Type)]) (ctx :: [ErrorMessage]) (e :: ErrorMessage). MapCtxAsp r ctx (('Text "- traceAspect: " :<>: e) ': ctx) => Proxy e -> CAspect (('Text "- traceAspect: " :<>: e) ': ctx) r -> CAspect ctx (ResMapCtx r ctx (('Text "- traceAspect: " :<>: e) ': ctx)) Source #

|traceAspect| adds context to an aspect.

traceRule :: forall (e :: ErrorMessage) (ctx :: [ErrorMessage]) (prd :: Prod) (sc :: [(Child, [(Att, Type)])]) (ip :: [(Att, Type)]) (ic :: [(Child, [(Att, Type)])]) (sp :: [(Att, Type)]) (ic' :: [(Child, [(Att, Type)])]) (sp' :: [(Att, Type)]). Proxy e -> CRule (('Text "- traceRule: " :<>: e) ': ctx) prd sc ip ic sp ic' sp' -> CRule ctx prd sc ip ic sp ic' sp' Source #

copyAtChi :: forall (prd' :: Symbol) (nt' :: NT) (chi :: Symbol) (ntch :: Either NT T) (v2 :: [(Att, Type)]) (ic :: [(Child, [(Att, Type)])]) (ctx :: [ErrorMessage]) (att :: Symbol) t' (r :: [(Att, Type)]) (ic' :: [(Child, [(Att, Type)])]) (sc :: [(Child, [(Att, Type)])]) (ip :: [(Att, Type)]) (sp :: [(Att, Type)]). (Require (OpUpdate (ChiReco ('Prd prd' nt')) ('Chi chi ('Prd prd' nt') ntch) v2 ic) ctx, Require (OpExtend AttReco ('Att att t') t' r) ctx, Require (OpLookup (ChiReco ('Prd prd' nt')) ('Chi chi ('Prd prd' nt') ntch) ic) ctx, At Lhs ('Att att t') ((->) (Proxy ctx) :: Type -> Type), ReqR (OpExtend AttReco ('Att att t') t' r) ~ Attribution v2, ReqR (OpUpdate (ChiReco ('Prd prd' nt')) ('Chi chi ('Prd prd' nt') ntch) v2 ic) ~ ChAttsRec ('Prd prd' nt') ic', ResAt Lhs ('Att att t') ((->) (Proxy ctx) :: Type -> Type) ~ (Fam ('Prd prd' nt') sc ip -> t'), ReqR (OpLookup (ChiReco ('Prd prd' nt')) ('Chi chi ('Prd prd' nt') ntch) ic) ~ Attribution r) => Label ('Att att t') -> Label ('Chi chi ('Prd prd' nt') ntch) -> CRule ctx ('Prd prd' nt') sc ip ic sp ic' sp Source #

a rule to copy one attribute att from the parent to the children chi

emptyAspectC :: EmptyAspect prds polyArgs ctx => KList prds -> Proxy polyArgs -> CAspect ctx (EmptyAspectR prds polyArgs ctx) Source #

emptyAspectForProds :: forall (prds :: [Prod]) (polyArgs :: [([(Child, [(Att, Type)])], [(Att, Type)], [(Child, [(Att, Type)])], [(Att, Type)])]) (ctx :: [ErrorMessage]). EmptyAspect prds polyArgs ctx => KList prds -> CAspect ctx (EmptyAspectR prds polyArgs ctx) Source #

type family Terminal s :: Either NT T where ... Source #

Equations

Terminal s = 'Right ('T s) 

type family NonTerminal s where ... Source #

Equations

NonTerminal s = 'Left s 

(+++) :: Proxy e1 -> Proxy e2 -> Proxy (e1 :$$: e2) Source #

empties :: Empties fc prd => Record fc -> ChAttsRec prd (EmptiesR fc) Source #