co-log-core 0.0.0 → 0.1.0
raw patch · 3 files changed
+27/−11 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
- Colog.Core.Action: cbind :: Monad m => (a -> m b) -> LogAction m b -> LogAction m a
+ Colog.Core.Action: cmapM :: Monad m => (a -> m b) -> LogAction m b -> LogAction m a
Files
- CHANGELOG.md +10/−2
- co-log-core.cabal +10/−2
- src/Colog/Core/Action.hs +7/−7
CHANGELOG.md view
@@ -1,13 +1,21 @@ Change log ========== -co-log uses [PVP Versioning][1].+`co-log-core` uses [PVP Versioning][1]. The change log is available [on GitHub][2]. +0.1.0+=====++* [#38](https://github.com/kowainik/co-log/issues/38):+ Rename `cbind` to `cmapM`.++* [#37](https://github.com/kowainik/co-log/issues/37):+ Add `base` bounds.+ 0.0.0 ===== * Initially created. [1]: https://pvp.haskell.org [2]: https://github.com/kowainik/co-log/releases-
co-log-core.cabal view
@@ -1,5 +1,5 @@ name: co-log-core-version: 0.0.0+version: 0.1.0 description: Logging library synopsis: Logging library homepage: https://github.com/kowainik/co-log@@ -26,8 +26,16 @@ Colog.Core.Class Colog.Core.Severity - ghc-options: -Wall -fhide-source-paths build-depends: base >= 4.11 && < 5++ ghc-options: -Wall+ -Wincomplete-uni-patterns+ -Wincomplete-record-updates+ -Wcompat+ -Widentities+ -Wredundant-constraints+ -fhide-source-paths+ -freverse-errors default-language: Haskell2010 default-extensions: InstanceSigs
src/Colog/Core/Action.hs view
@@ -15,7 +15,7 @@ , cmap , (>$<) , (>$)- , cbind+ , cmapM -- * Divisible combinators , divide@@ -184,7 +184,7 @@ (>$) :: b -> LogAction m b -> LogAction m a (>$) b (LogAction action) = LogAction (\_ -> action b) -{- | 'cbind' combinator is similar to 'cmap' but allows to call monadic+{- | 'cmapM' combinator is similar to 'cmap' but allows to call monadic functions (functions that require extra context) to extend consumed value. Consider the following example. @@ -219,16 +219,16 @@ pure (LR time msg) @ -you can achieve desired behavior with 'cbind' in the following way:+you can achieve desired behavior with 'cmapM' in the following way: @ logTextAction :: 'LogAction' IO Text-logTextAction = 'cbind' withTime myAction+logTextAction = 'cmapM' withTime myAction @ -}-cbind :: Monad m => (a -> m b) -> LogAction m b -> LogAction m a-cbind f (LogAction action) = LogAction (f >=> action)-{-# INLINE cbind #-}+cmapM :: Monad m => (a -> m b) -> LogAction m b -> LogAction m a+cmapM f (LogAction action) = LogAction (f >=> action)+{-# INLINE cmapM #-} -- | @divide@ combinator from @Divisible@ type class. divide :: (Applicative m) => (a -> (b, c)) -> LogAction m b -> LogAction m c -> LogAction m a