diff --git a/src/Control/Monad/Effect/Store.hs b/src/Control/Monad/Effect/Store.hs deleted file mode 100644 index 6de18f955..000000000 --- a/src/Control/Monad/Effect/Store.hs +++ /dev/null @@ -1,34 +0,0 @@ -{-# LANGUAGE DataKinds, FlexibleContexts, FlexibleInstances, MultiParamTypeClasses, ScopedTypeVariables, TypeFamilyDependencies, TypeFamilies, TypeOperators, UndecidableInstances #-} -module Control.Monad.Effect.Store -( assign -, MonadStore(..) -, modifyStore -) where - -import Prologue -import Control.Monad.Effect -import Control.Monad.Effect.State -import Data.Abstract.Address -import Data.Abstract.Store -import Data.Abstract.Value - --- | Write a value to the given 'Address' in the 'Store'. -assign :: (Ord (LocationFor a), Semigroup (Cell (LocationFor a) a), Pointed (Cell (LocationFor a)), MonadStore a m) => Address (LocationFor a) a -> a -> m () -assign address = modifyStore . storeInsert address - - --- | 'Monad's offering a readable & writable 'Store' of values for specific 'Address'es. -class Monad m => MonadStore a m where - -- | Get the current store. - getStore :: m (Store (LocationFor a) a) - - -- | Update the current store. - putStore :: Store (LocationFor a) a -> m () - -instance (State (Store (LocationFor a) a) :< fs) => MonadStore a (Eff fs) where - getStore = get - putStore = put - --- | Modify the current store using a given function. -modifyStore :: MonadStore a m => (Store (LocationFor a) a -> Store (LocationFor a) a) -> m () -modifyStore f = getStore >>= putStore . f