context-stack 0.1.0.0 → 0.1.0.1
raw patch · 2 files changed
+7/−7 lines, 2 filesdep −data-default
Dependencies removed: data-default
Files
- context-stack.cabal +2/−2
- src/Data/ContextStack.hs +5/−5
context-stack.cabal view
@@ -2,7 +2,7 @@ -- documentation, see http://haskell.org/cabal/users-guide/ name: context-stack-version: 0.1.0.0+version: 0.1.0.1 synopsis: An abstraction of a stack and stack-based monadic context. -- description: homepage: http://github.com/thinkpad20/context-stack@@ -20,6 +20,6 @@ exposed-modules: Data.ContextStack -- other-modules: other-extensions: NoImplicitPrelude, TypeFamilies, FlexibleContexts, LambdaCase, OverloadedStrings- build-depends: base >=4.7 && <4.8, classy-prelude, unordered-containers, mtl, data-default+ build-depends: base >=4.7 && <4.8, classy-prelude, unordered-containers, mtl hs-source-dirs: src default-language: Haskell2010
src/Data/ContextStack.hs view
@@ -11,7 +11,6 @@ import qualified Prelude as P import qualified Data.HashMap.Strict as H-import Data.Default import Control.Monad.State.Strict import Control.Monad.Except import ClassyPrelude hiding (find, asList)@@ -78,10 +77,10 @@ loadBindings = H.union -- | Converts a list into a `KeyValueStore`.-buildMap :: (Default s, KeyValueStore s, MonoFoldable collection,+buildMap :: (KeyValueStore s, MonoFoldable collection, Element collection ~ (LookupKey s, StoredValue s)) => collection -> s-buildMap = foldr (uncurry putValue) def+buildMap = foldr (uncurry putValue) empty -- | Stores @name => item@ on the top of the stack. store :: (Stack s, KeyValueStore (Frame s), MonadState s m)@@ -134,7 +133,8 @@ -- | Performs an action with the given bindings in scope. withBindings :: (Stack s, KeyValueStore (Frame s), MonadState s m,- Applicative m, Default (Frame s), MonoFoldable collection,- Element collection ~ (LookupKey (Frame s), StoredValue (Frame s)))+ Applicative m, MonoFoldable collection,+ Element collection ~+ (LookupKey (Frame s), StoredValue (Frame s))) => collection -> m a -> m a withBindings bindings = withFrame (buildMap bindings)