base64-lens 0.2.0 → 0.3.0
raw patch · 5 files changed
+30/−37 lines, 5 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- CHANGELOG.md +5/−0
- README.md +5/−17
- base64-lens.cabal +2/−2
- src/Data/ByteString/Base64/Lens.hs +9/−9
- src/Data/Text/Encoding/Base64/Lens.hs +9/−9
CHANGELOG.md view
@@ -1,5 +1,10 @@ # Revision history for base64-lens +## 0.3++* Instead of focusing on the `Base64Lenient` `Iso` as a `Lens` (which swaps its focus compared to its sibling `Prism`s),+ change it to be symmetrical with the other `Prism`s so that it can be used as a generalized `Prism`.+ ## 0.2 * Bump `base64` dependency to settle on 0.4 with the "finalized" api.
README.md view
@@ -13,20 +13,14 @@ pattern Base64 :: ByteString -> ByteString pattern Base64Url :: ByteString -> ByteString pattern Base64UrlUnpadded :: ByteString -> ByteString+pattern Base64Lenient :: ByteString -> ByteString+pattern Base64UrlLenient :: ByteString -> ByteString --- and+-- and pattern Base64 :: Text -> Text pattern Base64Url :: Text -> Text pattern Base64UrlUnpadded :: Text -> Text---- additionally if using >=base64-0.3--pattern Base64Lenient :: ByteString -> ByteString-pattern Base64UrlLenient :: ByteString -> ByteString---- and- pattern Base64Lenient :: Text -> Text pattern Base64UrlLenient :: Text -> Text ```@@ -43,20 +37,14 @@ _Base64 :: Prism' ByteString ByteString _Base64Url :: Prism' ByteString ByteString _Base64UrlUnpadded :: Prism' ByteString ByteString+_Base64Lenient :: Iso' ByteString ByteString+_Base64UrlLenient :: Iso' ByteString ByteString -- and _Base64 :: Prism' Text Text _Base64Url :: Prism' Text Text _Base64UrlUnpadded :: Prism' Text Text---- additionally if using >=base64-0.3--_Base64Lenient :: Iso' ByteString ByteString-_Base64UrlLenient :: Iso' ByteString ByteString---- and- _Base64Lenient :: Iso' Text Text _Base64UrlLenient :: Iso' Text Text ```
base64-lens.cabal view
@@ -1,7 +1,7 @@ cabal-version: 1.24 name: base64-lens-version: 0.2.0+version: 0.3.0 synopsis: Optics for the Base64 library description: Prisms and pattern synonyms for the Base64 library@@ -39,7 +39,7 @@ build-depends: base >=4.10 && <5 , base64 >=0.4 && <0.5 , bytestring >=0.10 && <0.11- , lens >=4.0 && <4.19+ , lens >=4.0 && <5 , text >=1.2 && <1.3 hs-source-dirs: src
src/Data/ByteString/Base64/Lens.hs view
@@ -9,7 +9,7 @@ -- Stability : Experimental -- Portability : non-portable ----- This module contains 'Prism''s for Base64-encoding and+-- This module contains 'Prism''s and 'Iso''s for Base64-encoding and -- decoding 'ByteString' values. -- module Data.ByteString.Base64.Lens@@ -97,31 +97,31 @@ -- using lenient decoding. -- ----- _Note:_ This is not a lawful 'Iso'.+-- _Note:_ This is not a lawful 'Iso'. Please take care! ----- >>> "Sun" ^. _Base64Lenient+-- >>> _Base64Lenient # "Sun" -- "U3Vu" ----- >>> "U3Vu" ^. from _Base64Lenient+-- >>> "U3Vu" ^. _Base64Lenient -- "Sun" -- _Base64Lenient :: Iso' ByteString ByteString-_Base64Lenient = iso B64.encodeBase64' B64.decodeBase64Lenient+_Base64Lenient = iso B64.decodeBase64Lenient B64.encodeBase64' -- | An 'Iso'' into the Base64url encoding of a 'ByteString' value -- using lenient decoding. -- ----- _Note:_ This is not a lawful 'Iso'.+-- _Note:_ This is not a lawful 'Iso'. Please take care! ----- >>> "<<??>>" ^. _Base64UrlLenient+-- >>> _Base64UrlLenient # "<<??>>" -- "PDw_Pz4-" ----- >>> "PDw_Pz4-" ^. from _Base64UrlLenient+-- >>> "PDw_Pz4-" ^. _Base64UrlLenient -- "<<??>>" -- _Base64UrlLenient :: Iso' ByteString ByteString-_Base64UrlLenient = iso B64U.encodeBase64' B64U.decodeBase64Lenient+_Base64UrlLenient = iso B64U.decodeBase64Lenient B64U.encodeBase64' -- -------------------------------------------------------------------------- -- -- Patterns
src/Data/Text/Encoding/Base64/Lens.hs view
@@ -9,7 +9,7 @@ -- Stability : Experimental -- Portability : non-portable ----- This module contains 'Prism's Base64-encoding and+-- This module contains 'Prism's and 'Iso''s Base64-encoding and -- decoding 'Text' values. -- module Data.Text.Encoding.Base64.Lens@@ -95,31 +95,31 @@ -- using lenient decoding. -- ----- _Note:_ This is not a lawful 'Iso'.+-- _Note:_ This is not a lawful 'Iso' in general. Please take care! ----- >>> "Sun" ^. _Base64Lenient+-- >>> _Base64Lenient # "Sun" -- "U3Vu" ----- >>> "U3Vu" ^. from _Base64Lenient+-- >>> "U3Vu" ^. _Base64Lenient -- "Sun" -- _Base64Lenient :: Iso' Text Text-_Base64Lenient = iso B64T.encodeBase64 B64T.decodeBase64Lenient+_Base64Lenient = iso B64T.decodeBase64Lenient B64T.encodeBase64 -- | An 'Iso'' into the Base64url encoding of a 'Text' value -- using lenient decoding. -- ----- _Note:_ This is not a lawful 'Iso'.+-- _Note:_ This is not a lawful 'Iso' in general. Please take care! ----- >>> "<<??>>" ^. _Base64UrlLenient+-- >>> _Base64UrlLenient # "<<??>>" -- "PDw_Pz4-" ----- >>> "PDw_Pz4-" ^. from _Base64UrlLenient+-- >>> "PDw_Pz4-" ^. _Base64UrlLenient -- "<<??>>" -- _Base64UrlLenient :: Iso' Text Text-_Base64UrlLenient = iso B64TU.encodeBase64 B64TU.decodeBase64Lenient+_Base64UrlLenient = iso B64TU.decodeBase64Lenient B64TU.encodeBase64 -- -------------------------------------------------------------------------- -- -- Patterns