Copyright | (c) 2019 Emily Pillmore |
---|---|
License | BSD-style |
Maintainer | Emily Pillmore <emilypi@cohomolo.gy> |
Stability | Experimental |
Portability | TypeFamilies |
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- class AsBase64 s where
- type Base64 s
- _Base64 :: Prism' s (Base64 s)
- _Base64Url :: Prism' s (Base64 s)
- class AsBase64Unpadded s where
- type Base64Unpadded s
- _Base64Unpadded :: Prism' s (Base64Unpadded s)
- _Base64UrlUnpadded :: Prism' s (Base64Unpadded s)
Classy Prisms
class AsBase64 s where Source #
If a particular type s
has a base64 representation
for any of its focii, this class provides the optical interface
for satisfying the padded base64 spec in RFC 4648
_Base64 :: Prism' s (Base64 s) Source #
A prism into a base64-encoded focus of some type
Examples:
>>>
_Base64 @Text # "Sun"
"UV3u" -->>>
"PDw/Pz8+Pg==" ^? _Base64
Just "<<???>>"
_Base64Url :: Prism' s (Base64 s) Source #
A prism into the base64url-encoded focus of some type
Examples:
>>>
_Base64Url @Text # "Sun"
"UV3u"
>>>
"PDw_Pz8-Pg==" ^? _Base64Url
Just "<<???>>"
Instances
AsBase64 ByteString Source # | |
Defined in Data.ByteString.Base64.Lens type Base64 ByteString :: Type Source # _Base64 :: Prism' ByteString (Base64 ByteString) Source # _Base64Url :: Prism' ByteString (Base64 ByteString) Source # | |
AsBase64 Text Source # | |
class AsBase64Unpadded s where Source #
If a particular type a
has an unpadded base64 representation
for any of its focii, this class provides the optical interface
for satisfying the unpadded base64 spec in RFC 4648
type Base64Unpadded s Source #
_Base64Unpadded :: Prism' s (Base64Unpadded s) Source #
A prism into the unpadded base64-encoded focus of some type
_Base64UrlUnpadded :: Prism' s (Base64Unpadded s) Source #
A prism into the unpadded base64url-encoded focus of some type
Instances
AsBase64Unpadded ByteString Source # | |
Defined in Data.ByteString.Base64.Lens type Base64Unpadded ByteString :: Type Source # _Base64Unpadded :: Prism' ByteString (Base64Unpadded ByteString) Source # _Base64UrlUnpadded :: Prism' ByteString (Base64Unpadded ByteString) Source # | |
AsBase64Unpadded Text Source # | |
Defined in Data.Text.Encoding.Base64.Lens type Base64Unpadded Text :: Type Source # _Base64Unpadded :: Prism' Text (Base64Unpadded Text) Source # _Base64UrlUnpadded :: Prism' Text (Base64Unpadded Text) Source # |