packages feed

ngx-export-tools 1.2.0 → 1.2.1

raw patch · 3 files changed

+37/−5 lines, 3 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ NgxExport.Tools.Combinators: voidHandler' :: IO a -> b -> IO ByteString

Files

Changelog.md view
@@ -1,3 +1,7 @@+### 1.2.1++- Added function *voidHandler'* in module *NgxExport.Tools.Combinators*.+ ### 1.2.0  - Added a new module *NgxExport.Tools.Combinators* which exports a new function
NgxExport/Tools/Combinators.hs view
@@ -15,8 +15,9 @@     -- * Combinators of effectful actions     -- $description -    -- * Void handler+    -- * Exported functions                                     voidHandler+                                   ,voidHandler'     -- * Split services                                    ,module NgxExport.Tools.SplitService                                    ) where@@ -27,12 +28,12 @@  -- $description ----- A set of convenient combinators of effectful actions for building handlers--- and services tuned for special purposes.+-- A set of functions to combine effectful actions for building handlers and+-- services tuned for special purposes.  -- | Runs an effectful computation and then returns an empty 'L.ByteString' ----- This combinator saves printing the final @return L.empty@ action in handlers+-- This function saves printing the final @return L.empty@ action in handlers -- that return unused or empty 'L.ByteString'. -- -- For example, handler /signalUpconf/ being declared as an@@ -65,4 +66,31 @@ voidHandler :: IO a                         -- ^ Target computation             -> IO L.ByteString voidHandler = (>> return L.empty)++-- | Runs an effectful computation and then returns an empty 'L.ByteString'+--+-- The same as 'voidHandler' except it accepts an additional value which is+-- ignored. Implemented as+--+-- @+-- voidHandler' = const . 'voidHandler'+-- @+--+-- This can be useful in declarations of services that accept a boolean flag+-- which marks whether the service is running for the first time. This flag is+-- often ignored though, in which case using @voidHandler'@ can simplify code.+--+-- For instance, handler /signalUpconf/ from the example for 'voidHandler' can+-- be further simplified as+--+-- @+-- signalUpconf :: Upconf -> Bool -> IO L.ByteString+-- signalUpconf = __/voidHandler'/__ . mapConcurrently_ getUrl+-- @+--+-- @since 1.2.1+voidHandler' :: IO a                        -- ^ Target computation+             -> b                           -- ^ Ignored value+             -> IO L.ByteString+voidHandler' = const . voidHandler 
ngx-export-tools.cabal view
@@ -1,5 +1,5 @@ name:                       ngx-export-tools-version:                    1.2.0+version:                    1.2.1 synopsis:                   Extra tools for Nginx haskell module description:                Extra tools for         <https://github.com/lyokha/nginx-haskell-module Nginx haskell module>.