minor tidyings
This commit is contained in:
parent
7126f0e75b
commit
b982072281
@ -100,17 +100,12 @@ data BodyConstraint = BodyConstraint {
|
||||
|
||||
data RuleContext = RuleContext {
|
||||
__relation :: Relation,
|
||||
-- _variableNames :: [Text],
|
||||
_headVariables :: [RuleElement],
|
||||
_bodyConstraints :: [BodyConstraint],
|
||||
_db :: NaiveDatabase
|
||||
}
|
||||
|
||||
toElement :: Term -> RuleElement
|
||||
-- toElement constant@(Var _) = RuleElementConstant constant
|
||||
-- toElement constant@(Num _) = RuleElementConstant constant
|
||||
toElement (Var name) = RuleElementVariable name
|
||||
toElement constant = RuleElementConstant constant
|
||||
|
||||
maybeConstant :: RuleElement -> Maybe Constant
|
||||
maybeConstant (RuleElementConstant constant) = Just constant
|
||||
maybeConstant _ = Nothing
|
||||
@ -202,6 +197,9 @@ withFactsAndRules facts rules =
|
||||
}
|
||||
newRelationMap = Map.insert relationName relation' relationMap
|
||||
constants' = constants db'
|
||||
toElement :: Term -> RuleElement
|
||||
toElement (Var name) = RuleElementVariable name
|
||||
toElement constant = RuleElementConstant constant
|
||||
|
||||
query :: NaiveDatabase -> Text -> Text
|
||||
query db qText =
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user