minor tidyings

This commit is contained in:
Felix Dilke 2026-01-27 16:19:00 +00:00
parent 7126f0e75b
commit b982072281

View File

@ -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 =