context 0.1.1.0 → 0.1.1.1
raw patch · 3 files changed
+15/−14 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- context.cabal +2/−2
- library/Context/Internal.hs +12/−11
- package.yaml +1/−1
context.cabal view
@@ -4,10 +4,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: ce95004f91aeb67f72f59d4f0974849fc2faec02ea490576740aab04f9ccf575+-- hash: 0a180699622cead385416ab9074b2b14a3483e2654062eeccb05d9d4e894efbe name: context-version: 0.1.1.0+version: 0.1.1.1 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
library/Context/Internal.hs view
@@ -245,11 +245,12 @@ Just (_context : rest) -> (state { stacks = Map.insert threadId rest stacks }, ()) --- | A 'View' provides a read-only view into a 'Store'. 'View' trades the--- 'Store' ability to register new context for the ability to arbitrarily--- transform context values locally to the 'View'.+-- | A 'Context.View.View' provides a read-only view into a 'Context.Store'.+-- 'Context.View.View' trades the 'Context.Store' ability to register new+-- context for the ability to arbitrarily transform context values locally to+-- the 'Context.View.View'. ----- @since 0.2.0.0+-- @since 0.1.1.0 data View ctx where MkView :: (ctx' -> ctx) -> Store ctx' -> View ctx @@ -257,24 +258,24 @@ fmap g (MkView f store) = MkView (g . f) store -- | Provide the calling thread a view of its current context from the specified--- 'View'. Throws a 'Context.NotFoundException' when the calling thread has no--- registered context.+-- 'Context.View.View'. Throws a 'Context.NotFoundException' when the calling+-- thread has no registered context. ----- @since 0.2.0.0+-- @since 0.1.1.0 view :: View ctx -> IO ctx view = maybe throwContextNotFound pure <=< viewMay -- | Provide the calling thread a view of its current context from the specified--- 'View', if present.+-- 'Context.View.View', if present. ----- @since 0.2.0.0+-- @since 0.1.1.0 viewMay :: View ctx -> IO (Maybe ctx) viewMay = \case MkView f store -> fmap (fmap f) $ mineMay store --- | Create a 'View' from the provided 'Store'.+-- | Create a 'Context.View.View' from the provided 'Context.Store'. ----- @since 0.2.0.0+-- @since 0.1.1.0 toView :: Store ctx -> View ctx toView = MkView id
package.yaml view
@@ -1,5 +1,5 @@ name: context-version: '0.1.1.0'+version: '0.1.1.1' github: "jship/context" license: MIT license-file: LICENSE.md