extendRuleBaseList,
ruleBaseIds, pprRuleBase, ruleCheckProgram,
extendRuleBaseList,
ruleBaseIds, pprRuleBase, ruleCheckProgram,
-- Add a new rule to an existing bunch of rules.
-- The rules are for the given Id; the Id argument is needed only
-- Add a new rule to an existing bunch of rules.
-- The rules are for the given Id; the Id argument is needed only
-- We make no check for rules that unify without one dominating
-- the other. Arguably this would be a bug.
-- We make no check for rules that unify without one dominating
-- the other. Arguably this would be a bug.
addRule id (Rules rules rhs_fvs) rule@(BuiltinRule _ _)
= Rules (rule:rules) rhs_fvs
-- Put it at the start for lack of anything better
addRule id (Rules rules rhs_fvs) rule@(BuiltinRule _ _)
= Rules (rule:rules) rhs_fvs
-- Put it at the start for lack of anything better