cookie 0.4.2.1 → 0.4.3
raw patch · 3 files changed
+26/−14 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Web.Cookie: defaultSetCookie :: SetCookie
Files
- ChangeLog.md +4/−0
- Web/Cookie.hs +21/−13
- cookie.cabal +1/−1
ChangeLog.md view
@@ -1,3 +1,7 @@+## 0.4.3++* Added `defaultSetCookie` [#16](https://github.com/snoyberg/cookie/pull/16)+ ## 0.4.2.1 * Clarified MIT license
Web/Cookie.hs view
@@ -19,6 +19,7 @@ -- ** Functions , parseSetCookie , renderSetCookie+ , defaultSetCookie , def -- * Client to server , Cookies@@ -106,12 +107,12 @@ -- -- ==== Creating a SetCookie ----- 'SetCookie' does not export a constructor; instead, use the 'Default' instance to create one and override values (see <http://www.yesodweb.com/book/settings-types> for details):+-- 'SetCookie' does not export a constructor; instead, use 'defaultSetCookie' and override values (see <http://www.yesodweb.com/book/settings-types> for details): -- -- @ -- import Web.Cookie -- :set -XOverloadedStrings--- let cookie = 'def' { 'setCookieName' = "cookieName", 'setCookieValue' = "cookieValue" }+-- let cookie = 'defaultSetCookie' { 'setCookieName' = "cookieName", 'setCookieValue' = "cookieValue" } -- @ -- -- ==== Cookie Configuration@@ -158,18 +159,25 @@ rnfMBS Nothing = () rnfMBS (Just bs) = bs `seq` () +-- | @'def' = 'defaultSetCookie'@ instance Default SetCookie where- def = SetCookie- { setCookieName = "name"- , setCookieValue = "value"- , setCookiePath = Nothing- , setCookieExpires = Nothing- , setCookieMaxAge = Nothing- , setCookieDomain = Nothing- , setCookieHttpOnly = False- , setCookieSecure = False- , setCookieSameSite = Nothing- }+ def = defaultSetCookie++-- | A minimal 'SetCookie'. All fields are 'Nothing' or 'False' except @'setCookieName' = "name"@ and @'setCookieValue' = "value"@. You need this to construct a 'SetCookie', because it does not export a constructor. Equivalently, you may use 'def'.+--+-- @since 0.4.2.2+defaultSetCookie :: SetCookie+defaultSetCookie = SetCookie+ { setCookieName = "name"+ , setCookieValue = "value"+ , setCookiePath = Nothing+ , setCookieExpires = Nothing+ , setCookieMaxAge = Nothing+ , setCookieDomain = Nothing+ , setCookieHttpOnly = False+ , setCookieSecure = False+ , setCookieSameSite = Nothing+ } renderSetCookie :: SetCookie -> Builder renderSetCookie sc = mconcat
cookie.cabal view
@@ -1,5 +1,5 @@ name: cookie-version: 0.4.2.1+version: 0.4.3 license: MIT license-file: LICENSE author: Michael Snoyman <michael@snoyman.com>