1
1
mirror of https://github.com/github/semantic.git synced 2024-12-27 17:05:33 +03:00

Extract the Precise-specific handler for Deref.

This commit is contained in:
Rob Rix 2018-08-13 09:17:47 -04:00
parent 3902cbfd2d
commit 137aabc77a

View File

@ -37,6 +37,8 @@ handleAllocator (Alloc _) = Precise <$> fresh
runDeref :: PureEffects effects runDeref :: PureEffects effects
=> Evaluator Precise value (Deref Precise value ': effects) a => Evaluator Precise value (Deref Precise value ': effects) a
-> Evaluator Precise value effects a -> Evaluator Precise value effects a
runDeref = interpret $ \case runDeref = interpret handleDeref
DerefCell _ cell -> pure (fst <$> Set.minView cell)
AssignCell _ value _ -> pure (Set.singleton value) handleDeref :: Deref Precise value (Eff (Deref Precise value ': effects)) a -> Evaluator Precise value effects a
handleDeref (DerefCell _ cell) = pure (fst <$> Set.minView cell)
handleDeref (AssignCell _ value _) = pure (Set.singleton value)