Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data RuleSet = RuleSet {}
- data RuleContext = RuleContext {}
- data Rule = Rule {}
- data FreshMetaId = FreshMetaId {
- name :: LabelMetaId
- prefix :: Maybe String
- data RuleTest = RuleTest {}
- newtype RuleTestOption = TakeOne {}
- data AttrsInBindings = AttrsInBindings {
- attrs :: [RuleAttribute]
- bindings :: [Binding]
- data Condition
- = IsNF { }
- | IsNFInsideFormation { }
- | PresentAttrs { }
- | AbsentAttrs { }
- | AttrNotEqual { }
- | ApplyInSubformations { }
- | ApplyInAbstractSubformations { }
- parseRuleSetFromFile :: FilePath -> IO RuleSet
- convertRule :: Rule -> Rule
- convertRuleNamed :: Rule -> NamedRule
- mkFreshSubst :: Context -> Object -> Maybe [FreshMetaId] -> Subst
- mkFreshAttributes :: Set LabelId -> [FreshMetaId] -> [(LabelMetaId, Attribute)]
- mkFreshAttribute :: Set LabelId -> FreshMetaId -> ((LabelMetaId, Attribute), Set LabelId)
- usedLabelIds :: Context -> Set LabelId
- objectLabelIds :: Object -> Set LabelId
- bindingLabelIds :: Binding -> Set LabelId
- attrLabelIds :: Attribute -> Set LabelId
- matchContext :: Context -> Maybe RuleContext -> [Subst]
- objectMetaIds :: Object -> Set MetaId
- bindingMetaIds :: Binding -> Set MetaId
- attrMetaIds :: Attribute -> Set MetaId
- objectHasMetavars :: Object -> Bool
- bindingHasMetavars :: Binding -> Bool
- attrHasMetavars :: Attribute -> Bool
- checkCond :: Context -> Condition -> Subst -> Bool
- hasAttr :: RuleAttribute -> [Binding] -> Bool
- data OneHoleContext = OneHoleContext {}
- data Subst = Subst {
- objectMetas :: [(ObjectMetaId, Object)]
- bindingsMetas :: [(BindingsMetaId, [Binding])]
- attributeMetas :: [(LabelMetaId, Attribute)]
- bytesMetas :: [(BytesMetaId, Bytes)]
- contextMetas :: [(TailMetaId, OneHoleContext)]
- emptySubst :: Subst
- applySubst :: Subst -> Object -> Object
- applySubstAttr :: Subst -> Attribute -> Attribute
- applySubstBindings :: Subst -> [Binding] -> [Binding]
- applySubstBinding :: Subst -> Binding -> [Binding]
- mergeSubst :: Subst -> Subst -> Subst
- matchObject :: Object -> Object -> [Subst]
- matchOneHoleContext :: TailMetaId -> Object -> Object -> [(Subst, OneHoleContext)]
- evaluateMetaFuncs :: Object -> Object -> Object
- data MetaState = MetaState {
- evaluateMetaFuncs' :: Object -> State MetaState Object
- evaluateMetaFuncsBinding :: Binding -> State MetaState Binding
- matchBindings :: [Binding] -> [Binding] -> [Subst]
- select :: [a] -> [(a, [a])]
- matchFindBinding :: Binding -> [Binding] -> [([Binding], Subst)]
- matchBinding :: Binding -> Binding -> [Subst]
- matchAttr :: Attribute -> Attribute -> [Subst]
- substThis :: Object -> Object -> Object
- substThisBinding :: Object -> Binding -> Binding
- contextualize :: Object -> Object -> Object
- contextualizeBinding :: Object -> Binding -> Binding
Documentation
>>>
:set -XOverloadedStrings
>>>
:set -XOverloadedLists
Instances
FromJSON RuleSet Source # | |
Generic RuleSet Source # | |
Show RuleSet Source # | |
type Rep RuleSet Source # | |
Defined in Language.EO.Phi.Rules.Yaml type Rep RuleSet = D1 ('MetaData "RuleSet" "Language.EO.Phi.Rules.Yaml" "eo-phi-normalizer-2.2.2-8uhvVJ4kNK79JRvN7mlnln" 'False) (C1 ('MetaCons "RuleSet" 'PrefixI 'True) (S1 ('MetaSel ('Just "title") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String) :*: S1 ('MetaSel ('Just "rules") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Rule]))) |
data RuleContext Source #
Instances
Instances
data FreshMetaId Source #
FreshMetaId | |
|
Instances
FromJSON FreshMetaId Source # | |
Defined in Language.EO.Phi.Rules.Yaml parseJSON :: Value -> Parser FreshMetaId # parseJSONList :: Value -> Parser [FreshMetaId] # | |
Generic FreshMetaId Source # | |
Defined in Language.EO.Phi.Rules.Yaml type Rep FreshMetaId :: Type -> Type # from :: FreshMetaId -> Rep FreshMetaId x # to :: Rep FreshMetaId x -> FreshMetaId # | |
Show FreshMetaId Source # | |
Defined in Language.EO.Phi.Rules.Yaml showsPrec :: Int -> FreshMetaId -> ShowS # show :: FreshMetaId -> String # showList :: [FreshMetaId] -> ShowS # | |
type Rep FreshMetaId Source # | |
Defined in Language.EO.Phi.Rules.Yaml type Rep FreshMetaId = D1 ('MetaData "FreshMetaId" "Language.EO.Phi.Rules.Yaml" "eo-phi-normalizer-2.2.2-8uhvVJ4kNK79JRvN7mlnln" 'False) (C1 ('MetaCons "FreshMetaId" 'PrefixI 'True) (S1 ('MetaSel ('Just "name") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 LabelMetaId) :*: S1 ('MetaSel ('Just "prefix") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe String)))) |
Instances
FromJSON RuleTest Source # | |
Generic RuleTest Source # | |
Show RuleTest Source # | |
type Rep RuleTest Source # | |
Defined in Language.EO.Phi.Rules.Yaml type Rep RuleTest = D1 ('MetaData "RuleTest" "Language.EO.Phi.Rules.Yaml" "eo-phi-normalizer-2.2.2-8uhvVJ4kNK79JRvN7mlnln" 'False) (C1 ('MetaCons "RuleTest" 'PrefixI 'True) ((S1 ('MetaSel ('Just "name") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String) :*: S1 ('MetaSel ('Just "input") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Object)) :*: (S1 ('MetaSel ('Just "output") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Object]) :*: S1 ('MetaSel ('Just "options") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe [RuleTestOption]))))) |
newtype RuleTestOption Source #
Instances
data AttrsInBindings Source #
AttrsInBindings | |
|
Instances
IsNF | |
IsNFInsideFormation | |
PresentAttrs | |
AbsentAttrs | |
AttrNotEqual | |
ApplyInSubformations | |
ApplyInAbstractSubformations | |
Instances
convertRule :: Rule -> Rule Source #
convertRuleNamed :: Rule -> NamedRule Source #
mkFreshSubst :: Context -> Object -> Maybe [FreshMetaId] -> Subst Source #
mkFreshAttributes :: Set LabelId -> [FreshMetaId] -> [(LabelMetaId, Attribute)] Source #
mkFreshAttribute :: Set LabelId -> FreshMetaId -> ((LabelMetaId, Attribute), Set LabelId) Source #
matchContext :: Context -> Maybe RuleContext -> [Subst] Source #
objectHasMetavars :: Object -> Bool Source #
bindingHasMetavars :: Binding -> Bool Source #
attrHasMetavars :: Attribute -> Bool Source #
checkCond :: Context -> Condition -> Subst -> Bool Source #
Given a condition, and a substition from object matching tells whether the condition matches the object
data OneHoleContext Source #
Instances
Show OneHoleContext Source # | |
Defined in Language.EO.Phi.Rules.Yaml showsPrec :: Int -> OneHoleContext -> ShowS # show :: OneHoleContext -> String # showList :: [OneHoleContext] -> ShowS # |
Subst | |
|
emptySubst :: Subst Source #
matchOneHoleContext :: TailMetaId -> Object -> Object -> [(Subst, OneHoleContext)] Source #
evaluateMetaFuncs :: Object -> Object -> Object Source #
Evaluate meta functions given top-level context as an object and an object
Orphan instances
FromJSON AlphaIndex Source # | |
parseJSON :: Value -> Parser AlphaIndex # parseJSONList :: Value -> Parser [AlphaIndex] # | |
FromJSON Attribute Source # | |
FromJSON Binding Source # | |
FromJSON BindingsMetaId Source # | |
parseJSON :: Value -> Parser BindingsMetaId # parseJSONList :: Value -> Parser [BindingsMetaId] # | |
FromJSON BytesMetaId Source # | |
parseJSON :: Value -> Parser BytesMetaId # parseJSONList :: Value -> Parser [BytesMetaId] # | |
FromJSON LabelId Source # | |
FromJSON LabelMetaId Source # | |
parseJSON :: Value -> Parser LabelMetaId # parseJSONList :: Value -> Parser [LabelMetaId] # | |
FromJSON MetaId Source # | |
FromJSON Object Source # | |
FromJSON ObjectMetaId Source # | |
parseJSON :: Value -> Parser ObjectMetaId # parseJSONList :: Value -> Parser [ObjectMetaId] # | |
FromJSON RuleAttribute Source # | |
parseJSON :: Value -> Parser RuleAttribute # parseJSONList :: Value -> Parser [RuleAttribute] # | |
FromJSON TailMetaId Source # | |
parseJSON :: Value -> Parser TailMetaId # parseJSONList :: Value -> Parser [TailMetaId] # |