mirror of
https://github.com/github/semantic.git
synced 2024-11-28 10:15:55 +03:00
Define a monovariant Heap carrier.
This commit is contained in:
parent
1b8dafcf33
commit
a17a6825d3
@ -1,6 +1,20 @@
|
||||
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
|
||||
module Analysis.Carrier.Heap.Monovariant
|
||||
( -- * Heap effect
|
||||
module Analysis.Effect.Heap
|
||||
( -- * Heap carrier
|
||||
runHeap
|
||||
, HeapC(..)
|
||||
-- * Heap effect
|
||||
, module Analysis.Effect.Heap
|
||||
) where
|
||||
|
||||
import Analysis.Effect.Heap
|
||||
import Control.Effect.State.Strict
|
||||
import qualified Control.Monad.Fail as Fail
|
||||
import qualified Data.Map as Map
|
||||
import qualified Data.Set as Set
|
||||
|
||||
runHeap :: HeapC addr value m a -> m (Map.Map addr (Set.Set value), a)
|
||||
runHeap (HeapC m) = runState Map.empty m
|
||||
|
||||
newtype HeapC addr value m a = HeapC (StateC (Map.Map addr (Set.Set value)) m a)
|
||||
deriving (Applicative, Functor, Monad, Fail.MonadFail)
|
||||
|
Loading…
Reference in New Issue
Block a user