base64-0.0.1.0: RFC 4648-compliant padded and unpadded base64 and base64url encodings

Copyright(c) 2019 Emily Pillmore
LicenseBSD-style
MaintainerEmily Pillmore <emilypi@cohomolo.gy>
StabilityExperimental
PortabilityTypeFamilies
Safe HaskellNone
LanguageHaskell2010

Data.Text.Encoding.Base64.Lens

Contents

Description

This module contains the AsBase64 and AsBase64Unpadded instances for Text, which defined to be the collection of Prisms defining the RFC 4648 specification for the padded and unpadded Base64 encoding format.

These typeclasses are re-exported for convenience

Synopsis

Documentation

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

Associated Types

type Base64 s Source #

Methods

_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 # 
Instance details

Defined in Data.ByteString.Base64.Lens

Associated Types

type Base64 ByteString :: Type Source #

AsBase64 Text Source # 
Instance details

Defined in Data.Text.Encoding.Base64.Lens

Associated Types

type Base64 Text :: Type Source #

Methods

_Base64 :: Prism' Text (Base64 Text) Source #

_Base64Url :: Prism' Text (Base64 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

Associated Types

type Base64Unpadded s Source #

Methods

_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

Orphan instances

AsBase64Unpadded Text Source # 
Instance details

Associated Types

type Base64Unpadded Text :: Type Source #

AsBase64 Text Source # 
Instance details

Associated Types

type Base64 Text :: Type Source #

Methods

_Base64 :: Prism' Text (Base64 Text) Source #

_Base64Url :: Prism' Text (Base64 Text) Source #