context 0.2.0.3 → 0.2.1.0
raw patch · 7 files changed
+43/−42 lines, 7 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- Context: data NotFoundException
- Context.Implicit: data NotFoundException
- Context.Internal: data NotFoundException
+ Context: newtype NotFoundException
+ Context.Implicit: newtype NotFoundException
+ Context.Internal: newtype NotFoundException
- Context.Concurrent: data ThreadId
+ Context.Concurrent: data () => ThreadId
Files
- CHANGELOG.md +4/−0
- LICENSE +21/−0
- LICENSE.md +0/−23
- README.md +1/−2
- context.cabal +6/−7
- library/Context/Internal.hs +6/−6
- package.yaml +5/−4
CHANGELOG.md view
@@ -1,5 +1,9 @@ # Change log +## 0.2.1.0++* Change `NotFoundException` from `data` to `newtype`+ ## 0.2.0.3 * Relax upper bound on `containers`: 0.7 -> 0.8
+ LICENSE view
@@ -0,0 +1,21 @@+MIT License++Copyright (c) 2020 Jason Shipman++Permission is hereby granted, free of charge, to any person obtaining a copy+of this software and associated documentation files (the "Software"), to deal+in the Software without restriction, including without limitation the rights+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell+copies of the Software, and to permit persons to whom the Software is+furnished to do so, subject to the following conditions:++The above copyright notice and this permission notice shall be included in all+copies or substantial portions of the Software.++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE+SOFTWARE.
− LICENSE.md
@@ -1,23 +0,0 @@-[The MIT License (MIT)][]--Copyright (c) 2020 Jason Shipman--Permission is hereby granted, free of charge, to any person obtaining a copy of-this software and associated documentation files (the "Software"), to deal in-the Software without restriction, including without limitation the rights to-use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies-of the Software, and to permit persons to whom the Software is furnished to do-so, subject to the following conditions:--The above copyright notice and this permission notice shall be included in all-copies or substantial portions of the Software.--THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE-SOFTWARE.--[The MIT License (MIT)]: https://opensource.org/licenses/MIT
README.md view
@@ -1,4 +1,4 @@-# [context][]+# context [![Version badge][]][version] @@ -29,6 +29,5 @@ See the Haddocks for more info on the library. -[context]: https://github.com/jship/context/context [Version badge]: https://img.shields.io/hackage/v/context?color=brightgreen&label=version&logo=haskell [version]: https://hackage.haskell.org/package/context
context.cabal view
@@ -1,33 +1,32 @@ cabal-version: 1.12 --- This file has been generated from package.yaml by hpack version 0.35.2.+-- This file has been generated from package.yaml by hpack version 0.36.0. -- -- see: https://github.com/sol/hpack name: context-version: 0.2.0.3+version: 0.2.1.0 synopsis: Thread-indexed, nested contexts description: Thread-indexed storage around arbitrary context values. The interface supports nesting context values per thread, and at any point, the calling thread may ask for their current context. category: Data-homepage: https://github.com/jship/context#readme-bug-reports: https://github.com/jship/context/issues+homepage: https://sr.ht/~jship/context/ author: Jason Shipman maintainer: Jason Shipman copyright: 2020 (c) Jason Shipman license: MIT-license-file: LICENSE.md+license-file: LICENSE build-type: Simple extra-source-files: CHANGELOG.md- LICENSE.md+ LICENSE package.yaml README.md source-repository head type: git- location: https://github.com/jship/context+ location: https://git.sr.ht/~jship/context/ library exposed-modules:
library/Context/Internal.hs view
@@ -85,7 +85,7 @@ -- registered context. -- -- @since 0.1.0.0-data NotFoundException = NotFoundException+newtype NotFoundException = NotFoundException { threadId :: ThreadId } deriving stock (Eq, Generic, Show) deriving anyclass Exception@@ -135,7 +135,7 @@ . (MonadIO m, MonadThrow m) => m a throwContextNotFound = do- threadId <- liftIO $ Concurrent.myThreadId+ threadId <- liftIO Concurrent.myThreadId Catch.throwM $ NotFoundException { threadId } -- | Provide the calling thread its current context from the specified@@ -156,7 +156,7 @@ -> Store ctx -> m (Maybe ctx) mineMayOnDefault onDefault Store { ref } = do- threadId <- liftIO $ Concurrent.myThreadId+ threadId <- liftIO Concurrent.myThreadId State { stacks, def } <- liftIO $ IORef.readIORef ref pure $ case Map.lookup threadId stacks of Nothing -> onDefault def@@ -243,7 +243,7 @@ -- 'Store' will contain context values that are always thread-specific. -> m (Store ctx) newStore propagationStrategy def = do- key <- liftIO $ Unique.newUnique+ key <- liftIO Unique.newUnique ref <- liftIO $ IORef.newIORef State { stacks = Map.empty, def } let store = Store { ref, key } case propagationStrategy of@@ -300,7 +300,7 @@ -- @since 0.1.1.0 viewMay :: (MonadIO m) => View ctx -> m (Maybe ctx) viewMay = \case- MkView f store -> fmap (fmap f) $ mineMay store+ MkView f store -> fmap f <$> mineMay store -- | Create a 'Context.View.View' from the provided 'Context.Store'. --@@ -367,7 +367,7 @@ bug prefix = error $ "Context." <> prefix <> ": Impossible! (if you see this message, please "- <> "report it as a bug at https://github.com/jship/context)"+ <> "report it as a bug)" -- $disclaimer --
package.yaml view
@@ -1,8 +1,9 @@ name: context-version: '0.2.0.3'-github: "jship/context"+version: '0.2.1.0'+homepage: https://sr.ht/~jship/context/+git: https://git.sr.ht/~jship/context/ license: MIT-license-file: LICENSE.md+license-file: LICENSE copyright: 2020 (c) Jason Shipman author: "Jason Shipman" maintainer: "Jason Shipman"@@ -15,7 +16,7 @@ extra-source-files: - CHANGELOG.md-- LICENSE.md+- LICENSE - package.yaml - README.md