From 367cfc4f5cec1674d2742da8a53872bce94d16a0 Mon Sep 17 00:00:00 2001 From: joshvera Date: Wed, 28 Feb 2018 15:29:40 -0500 Subject: [PATCH] Remove Control.Monad.Effect.Store --- src/Control/Monad/Effect/Store.hs | 34 ------------------------------- 1 file changed, 34 deletions(-) delete mode 100644 src/Control/Monad/Effect/Store.hs 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