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 Allocator.

This commit is contained in:
Rob Rix 2018-08-13 09:16:14 -04:00
parent 6506aeef36
commit 3902cbfd2d

View File

@ -29,7 +29,10 @@ runAllocator :: ( Member Fresh effects
) )
=> Evaluator Precise value (Allocator Precise ': effects) a => Evaluator Precise value (Allocator Precise ': effects) a
-> Evaluator Precise value effects a -> Evaluator Precise value effects a
runAllocator = interpret $ \ (Alloc _) -> Precise <$> fresh runAllocator = interpret handleAllocator
handleAllocator :: Member Fresh effects => Allocator Precise (Eff (Allocator Precise ': effects)) a -> Evaluator Precise value effects a
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