delinting
This commit is contained in:
parent
d75a6b054d
commit
697568a8c3
@ -1,8 +1,8 @@
|
||||
{-# HLINT ignore "Redundant flip" #-}
|
||||
{-# LANGUAGE ImportQualifiedPost #-}
|
||||
-- {-# LANGUAGE ImportQualifiedPost #-}
|
||||
-- {-# LANGUAGE InstanceSigs #-}
|
||||
{-# LANGUAGE ScopedTypeVariables #-}
|
||||
{-# OPTIONS_GHC -Wno-unrecognised-pragmas #-}
|
||||
{-# LANGUAGE InstanceSigs #-}
|
||||
{-# LANGUAGE BlockArguments #-}
|
||||
|
||||
module Datalog.NaiveQE where
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
{-# HLINT ignore "Redundant flip" #-}
|
||||
{-# LANGUAGE ImportQualifiedPost #-}
|
||||
-- {-# LANGUAGE ImportQualifiedPost #-}
|
||||
-- {-# LANGUAGE InstanceSigs #-}
|
||||
{-# LANGUAGE ScopedTypeVariables #-}
|
||||
{-# OPTIONS_GHC -Wno-unrecognised-pragmas #-}
|
||||
{-# LANGUAGE InstanceSigs #-}
|
||||
{-# LANGUAGE BlockArguments #-}
|
||||
|
||||
module Datalog.QueryEngine where
|
||||
|
||||
@ -28,7 +28,7 @@ extractRule ruleText =
|
||||
appendRule :: Relation -> RelationRule -> Relation
|
||||
appendRule relation rule =
|
||||
relation {
|
||||
_rules = rule : (_rules relation)
|
||||
_rules = rule : _rules relation
|
||||
}
|
||||
|
||||
toRuleBodyElement :: BodyConstraint -> RuleBodyElement
|
||||
@ -69,7 +69,7 @@ data (DatalogDB db) => RuleContext db = RuleContext
|
||||
}
|
||||
|
||||
digestHead :: (DatalogDB db) => db -> Relation -> Literal -> RuleContext db
|
||||
digestHead db relation (Literal neg relationName terms) =
|
||||
digestHead db relation (Literal _ _ terms) =
|
||||
RuleContext
|
||||
{ __relation = relation
|
||||
, _variableNames = variableNames
|
||||
@ -79,13 +79,13 @@ digestHead db relation (Literal neg relationName terms) =
|
||||
}
|
||||
where
|
||||
variableNames = nub $ extractVariableNames terms
|
||||
entries' = nub $ (headTermToElement variableNames) <$> terms
|
||||
entries' = nub $ headTermToElement variableNames <$> terms
|
||||
extraConstants = Set.fromList $ mapMaybe extractConstant entries' where
|
||||
extractConstant :: RuleElement -> Maybe Constant
|
||||
extractConstant (RuleElementConstant constant) = Just constant
|
||||
extractConstant _ = Nothing
|
||||
digestBody :: (DatalogDB db) => Literal -> RuleContext db -> RuleContext db
|
||||
digestBody (Literal neg subRelationName subTerms) context =
|
||||
digestBody (Literal _ subRelationName subTerms) context =
|
||||
context {
|
||||
_variableNames = variableNames
|
||||
, _bodyConstraints = newConstraint : constraints
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user