AspectAG-0.5.0.0: Strongly typed Attribute Grammars implemented using type-level programming.

Safe HaskellSafe
LanguageHaskell2010

Language.Grammars.AspectAG.Require

Documentation

class Require (op :: Type) (ctx :: [ErrorMessage]) where Source #

Associated Types

type ReqR op :: Type Source #

Methods

req :: Proxy ctx -> op -> ReqR op Source #

Instances
(TypeError ((Text "Error: " :<>: m) :$$: (Text "trace: " :<>: ShowCTX ctx)) :: Constraint) => Require (OpError m) ctx Source # 
Instance details

Defined in Language.Grammars.AspectAG.Require

Associated Types

type ReqR (OpError m) :: Type Source #

Methods

req :: Proxy ctx -> OpError m -> ReqR (OpError m) Source #

(RequireR (OpComAsp al ar) ctx (Aspect ar'), Require (OpComRA ctx prd sc ip ic sp ic' sp' ar') ctx) => Require (OpComAsp al ((,) prd (CRule ctx prd sc ip ic sp ic' sp') ': ar)) ctx Source # 
Instance details

Defined in Language.Grammars.AspectAG

Associated Types

type ReqR (OpComAsp al ((prd, CRule ctx prd sc ip ic sp ic' sp') ': ar)) :: Type Source #

Methods

req :: Proxy ctx -> OpComAsp al ((prd, CRule ctx prd sc ip ic sp ic' sp') ': ar) -> ReqR (OpComAsp al ((prd, CRule ctx prd sc ip ic sp ic' sp') ': ar)) Source #

Require (OpComAsp al ([] :: [(Prod, Type)])) ctx Source # 
Instance details

Defined in Language.Grammars.AspectAG

Associated Types

type ReqR (OpComAsp al []) :: Type Source #

Methods

req :: Proxy ctx -> OpComAsp al [] -> ReqR (OpComAsp al []) Source #

RequireEqRes t1 t2 ctx => Require (OpEq t1 t2) ctx Source # 
Instance details

Defined in Language.Grammars.AspectAG.Require

Associated Types

type ReqR (OpEq t1 t2) :: Type Source #

Methods

req :: Proxy ctx -> OpEq t1 t2 -> ReqR (OpEq t1 t2) Source #

Require (OpError ((Text "Empty " :<>: Text (ShowRec c)) :$$: Text " Required to be nonempty ")) ctx => Require (OpNonEmpty c ([] :: [(k, k')])) ctx Source # 
Instance details

Defined in Language.Grammars.AspectAG.GenRecord

Associated Types

type ReqR (OpNonEmpty c []) :: Type Source #

Methods

req :: Proxy ctx -> OpNonEmpty c [] -> ReqR (OpNonEmpty c []) Source #

Require (OpNonEmpty c ((,) l v ': r)) ctx Source # 
Instance details

Defined in Language.Grammars.AspectAG.GenRecord

Associated Types

type ReqR (OpNonEmpty c ((l, v) ': r)) :: Type Source #

Methods

req :: Proxy ctx -> OpNonEmpty c ((l, v) ': r) -> ReqR (OpNonEmpty c ((l, v) ': r)) Source #

Require (OpError ((Text "field not Found on " :<>: Text (ShowRec c)) :$$: ((Text "looking up the " :<>: Text (ShowField c)) :<>: ShowT l))) ctx => Require (OpLookup c l ([] :: [(k, k')])) ctx Source # 
Instance details

Defined in Language.Grammars.AspectAG.GenRecord

Associated Types

type ReqR (OpLookup c l []) :: Type Source #

Methods

req :: Proxy ctx -> OpLookup c l [] -> ReqR (OpLookup c l []) Source #

Require (OpLookup' (l == l') c l ((,) l' v ': r)) ctx => Require (OpLookup c l ((,) l' v ': r)) ctx Source # 
Instance details

Defined in Language.Grammars.AspectAG.GenRecord

Associated Types

type ReqR (OpLookup c l ((l', v) ': r)) :: Type Source #

Methods

req :: Proxy ctx -> OpLookup c l ((l', v) ': r) -> ReqR (OpLookup c l ((l', v) ': r)) Source #

(LabelSetF ((,) l v ': r) ~ b, Require (OpExtend' b c l v r) ctx) => Require (OpExtend c l v r) ctx Source # 
Instance details

Defined in Language.Grammars.AspectAG.GenRecord

Associated Types

type ReqR (OpExtend c l v r) :: Type Source #

Methods

req :: Proxy ctx -> OpExtend c l v r -> ReqR (OpExtend c l v r) Source #

Require (OpError ((Text "field not Found on " :<>: Text (ShowRec c)) :$$: ((Text "updating the " :<>: Text (ShowField c)) :<>: ShowT l))) ctx => Require (OpUpdate c l v ([] :: [(k, k')])) ctx Source # 
Instance details

Defined in Language.Grammars.AspectAG.GenRecord

Associated Types

type ReqR (OpUpdate c l v []) :: Type Source #

Methods

req :: Proxy ctx -> OpUpdate c l v [] -> ReqR (OpUpdate c l v []) Source #

Require (OpUpdate' (l == l') c l v ((,) l' v' ': r)) ctx => Require (OpUpdate c l v ((,) l' v' ': r)) ctx Source # 
Instance details

Defined in Language.Grammars.AspectAG.GenRecord

Associated Types

type ReqR (OpUpdate c l v ((l', v') ': r)) :: Type Source #

Methods

req :: Proxy ctx -> OpUpdate c l v ((l', v') ': r) -> ReqR (OpUpdate c l v ((l', v') ': r)) Source #

Require (OpLookup c l r) ctx => Require (OpLookup' False c l ((,) l' v ': r)) ctx Source # 
Instance details

Defined in Language.Grammars.AspectAG.GenRecord

Associated Types

type ReqR (OpLookup' False c l ((l', v) ': r)) :: Type Source #

Methods

req :: Proxy ctx -> OpLookup' False c l ((l', v) ': r) -> ReqR (OpLookup' False c l ((l', v) ': r)) Source #

Require (OpLookup' True c l ((,) l v ': r)) ctx Source # 
Instance details

Defined in Language.Grammars.AspectAG.GenRecord

Associated Types

type ReqR (OpLookup' True c l ((l, v) ': r)) :: Type Source #

Methods

req :: Proxy ctx -> OpLookup' True c l ((l, v) ': r) -> ReqR (OpLookup' True c l ((l, v) ': r)) Source #

Require (OpError ((Text "Duplicated Labels on " :<>: Text (ShowRec c)) :$$: ((Text "on the " :<>: Text (ShowField c)) :<>: ShowT l))) ctx => Require (OpExtend' False c l v r) ctx Source # 
Instance details

Defined in Language.Grammars.AspectAG.GenRecord

Associated Types

type ReqR (OpExtend' False c l v r) :: Type Source #

Methods

req :: Proxy ctx -> OpExtend' False c l v r -> ReqR (OpExtend' False c l v r) Source #

LabelSetF ((,) l v ': r) ~ True => Require (OpExtend' True c l v r) ctx Source # 
Instance details

Defined in Language.Grammars.AspectAG.GenRecord

Associated Types

type ReqR (OpExtend' True c l v r) :: Type Source #

Methods

req :: Proxy ctx -> OpExtend' True c l v r -> ReqR (OpExtend' True c l v r) Source #

(LabelSet ((,) l v ': r), LabelSet ((,) l v' ': r)) => Require (OpUpdate' True c l v ((,) l v' ': r)) ctx Source # 
Instance details

Defined in Language.Grammars.AspectAG.GenRecord

Associated Types

type ReqR (OpUpdate' True c l v ((l, v') ': r)) :: Type Source #

Methods

req :: Proxy ctx -> OpUpdate' True c l v ((l, v') ': r) -> ReqR (OpUpdate' True c l v ((l, v') ': r)) Source #

(Require (OpUpdate c l v r) ctx, (UnWrap (ReqR (OpUpdate c l v r)) :: [(k2, k1)]) ~ r0, LabelSet ((,) l' v' ': r0), ReqR (OpUpdate c l v r) ~ Rec c r0) => Require (OpUpdate' False c l v ((,) l' v' ': r)) ctx Source # 
Instance details

Defined in Language.Grammars.AspectAG.GenRecord

Associated Types

type ReqR (OpUpdate' False c l v ((l', v') ': r)) :: Type Source #

Methods

req :: Proxy ctx -> OpUpdate' False c l v ((l', v') ': r) -> ReqR (OpUpdate' False c l v ((l', v') ': r)) Source #

Require (OpComRA' (HasLabel prd a) ctx prd sc ip ic sp ic' sp' a) ctx => Require (OpComRA ctx prd sc ip ic sp ic' sp' a) ctx Source # 
Instance details

Defined in Language.Grammars.AspectAG

Associated Types

type ReqR (OpComRA ctx prd sc ip ic sp ic' sp' a) :: Type Source #

Methods

req :: Proxy ctx -> OpComRA ctx prd sc ip ic sp ic' sp' a -> ReqR (OpComRA ctx prd sc ip ic sp ic' sp' a) Source #

Require (OpExtend PrdReco prd (CRule ctx prd sc ip ic sp ic' sp') a) ctx => Require (OpComRA' False ctx prd sc ip ic sp ic' sp' a) ctx Source # 
Instance details

Defined in Language.Grammars.AspectAG

Associated Types

type ReqR (OpComRA' False ctx prd sc ip ic sp ic' sp' a) :: Type Source #

Methods

req :: Proxy ctx -> OpComRA' False ctx prd sc ip ic sp ic' sp' a -> ReqR (OpComRA' False ctx prd sc ip ic sp ic' sp' a) Source #

(Require (OpUpdate PrdReco prd (CRule ctx prd sc ip ic sp ic'' sp'') a) ctx, RequireR (OpLookup PrdReco prd a) ctx (CRule ctx prd sc ip ic sp ic' sp'), IC (ReqR (OpLookup PrdReco prd a)) ~ ic, SP (ReqR (OpLookup PrdReco prd a)) ~ sp) => Require (OpComRA' True ctx prd sc ip ic' sp' ic'' sp'' a) ctx Source # 
Instance details

Defined in Language.Grammars.AspectAG

Associated Types

type ReqR (OpComRA' True ctx prd sc ip ic' sp' ic'' sp'' a) :: Type Source #

Methods

req :: Proxy ctx -> OpComRA' True ctx prd sc ip ic' sp' ic'' sp'' a -> ReqR (OpComRA' True ctx prd sc ip ic' sp' ic'' sp'' a) Source #

data OpError (m :: ErrorMessage) Source #

Instances
(TypeError ((Text "Error: " :<>: m) :$$: (Text "trace: " :<>: ShowCTX ctx)) :: Constraint) => Require (OpError m) ctx Source # 
Instance details

Defined in Language.Grammars.AspectAG.Require

Associated Types

type ReqR (OpError m) :: Type Source #

Methods

req :: Proxy ctx -> OpError m -> ReqR (OpError m) Source #

type family ShowCTX (ctx :: [ErrorMessage]) :: ErrorMessage where ... Source #

Equations

ShowCTX '[] = Text "" 
ShowCTX (m ': ms) = m :$$: ShowCTX ms 

type family ShowEM (m :: ErrorMessage) :: ErrorMessage Source #

type family ShowT (t :: k) :: ErrorMessage Source #

Instances
type ShowT (t :: Type) Source # 
Instance details

Defined in Language.Grammars.AspectAG.Require

type ShowT (t :: Type) = ShowType t
type ShowT (T l :: T) Source # 
Instance details

Defined in Language.Grammars.AspectAG.RecordInstances

type ShowT (T l :: T) = Text "Terminal " :<>: ShowT l
type ShowT (NT l :: NT) Source # 
Instance details

Defined in Language.Grammars.AspectAG.RecordInstances

type ShowT (NT l :: NT) = Text "Non-Terminal " :<>: Text l
type ShowT (Prd l nt :: Prod) Source # 
Instance details

Defined in Language.Grammars.AspectAG.RecordInstances

type ShowT (Prd l nt :: Prod) = (ShowT nt :<>: Text "::Production ") :<>: Text l
type ShowT (Att l t :: Att) Source # 
Instance details

Defined in Language.Grammars.AspectAG.RecordInstances

type ShowT (Att l t :: Att) = ((Text "Attribute " :<>: Text l) :<>: Text ":") :<>: ShowT t
type ShowT (Chi l p s :: Child) Source # 
Instance details

Defined in Language.Grammars.AspectAG.RecordInstances

type ShowT (Chi l p s :: Child) = (((ShowT p :<>: Text "::Child ") :<>: Text l) :<>: Text ":") :<>: ShowT s
type ShowT (Right r :: Either a k) Source # 
Instance details

Defined in Language.Grammars.AspectAG.RecordInstances

type ShowT (Right r :: Either a k) = ShowT r
type ShowT (Left l :: Either k b) Source # 
Instance details

Defined in Language.Grammars.AspectAG.RecordInstances

type ShowT (Left l :: Either k b) = ShowT l

type RequireR (op :: Type) (ctx :: [ErrorMessage]) (res :: Type) = (Require op ctx, ReqR op ~ res) Source #

type RequireEq (t1 :: k) (t2 :: k) (ctx :: [ErrorMessage]) = (Require (OpEq t1 t2) ctx, t1 ~ t2) Source #

data OpEq t1 t2 Source #

Instances
RequireEqRes t1 t2 ctx => Require (OpEq t1 t2) ctx Source # 
Instance details

Defined in Language.Grammars.AspectAG.Require

Associated Types

type ReqR (OpEq t1 t2) :: Type Source #

Methods

req :: Proxy ctx -> OpEq t1 t2 -> ReqR (OpEq t1 t2) Source #

type ReqR (OpEq t1 t2) Source # 
Instance details

Defined in Language.Grammars.AspectAG.Require

type ReqR (OpEq t1 t2) = ()

type family RequireEqRes (t1 :: k) (t2 :: k) (ctx :: [ErrorMessage]) :: Constraint where ... Source #

Equations

RequireEqRes t1 t2 ctx = If (t1 `Equal` t2) (() :: Constraint) (Require (OpError (((Text "" :<>: ShowT t1) :<>: Text " /= ") :<>: ShowT t2)) ctx)