@@ -70,11 +70,12 @@ import Control.DeepSeq (NFData)
7070import Control.Monad.Except
7171import Control.Monad.State
7272import Data.Foldable
73- import qualified Data.HashSet as HashSet
7473import Data.Map (Map )
7574import qualified Data.Map as Map
7675import Data.Maybe
7776import Data.String
77+ import Data.Vector (Vector )
78+ import qualified Data.Vector as Vector
7879import Data.Text (Text , pack )
7980import Data.Void (vacuous )
8081import GHC.Clock (getMonotonicTime )
@@ -282,7 +283,7 @@ compilePred rules =
282283 if all isFact rules
283284 then
284285 -- We precompute the set
285- let setOfVals = HashSet . fromList $ fmap (mapMaybe termVal . litTerms . ruleLit) rules
286+ let setOfVals = Vector . fromList $ fmap (mapMaybe termVal . litTerms . ruleLit) rules
286287 in \ arg@ (Lit _ qas) -> do
287288 qas <- traverse subst qas
288289 let f term (allVals, vals) = case term of
@@ -293,7 +294,7 @@ compilePred rules =
293294 -- In that case, if the values of qas are in the set, the predicate succeeds.
294295 -- Otherwise, it fails.
295296 if allVals
296- then guard (HashSet. member vals setOfVals)
297+ then guard (Vector. elem vals setOfVals)
297298 -- If qas aren't all values, we can't use the set and must fallback to the default behavior.
298299 -- This is because in this case the variables will be unified with the values, so it's not just
299300 -- a guard.
0 commit comments