mirror of
https://github.com/github/semantic.git
synced 2024-12-26 08:25:19 +03:00
Extract the Precise-specific handler for Deref.
This commit is contained in:
parent
3902cbfd2d
commit
137aabc77a
@ -37,6 +37,8 @@ handleAllocator (Alloc _) = Precise <$> fresh
|
||||
runDeref :: PureEffects effects
|
||||
=> Evaluator Precise value (Deref Precise value ': effects) a
|
||||
-> Evaluator Precise value effects a
|
||||
runDeref = interpret $ \case
|
||||
DerefCell _ cell -> pure (fst <$> Set.minView cell)
|
||||
AssignCell _ value _ -> pure (Set.singleton value)
|
||||
runDeref = interpret handleDeref
|
||||
|
||||
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)
|
||||
|
Loading…
Reference in New Issue
Block a user