base32-lens-0.1.1.0: Optics for the Base32 library
Copyright(c) 2020 Emily Pillmore
LicenseBSD-style
MaintainerEmily Pillmore <emilypi@cohomolo.gy>
StabilityExperimental
Portabilitynon-portable
Safe HaskellSafe
LanguageHaskell2010

Data.Text.Short.Encoding.Base32.Lens

Description

This module contains Prisms Base32-encoding and decoding Text values.

Synopsis

Prisms

_Base32 :: Prism' ShortText ShortText Source #

A Prism into the Base32 encoding of a ShortText value.

>>> _Base32 # "Sun"
"KN2W4==="
>>> "KN2W4===" ^? _Base32
Just "Sun"

_Base32Unpadded :: Prism' ShortText ShortText Source #

A Prism into the Base32 encoding of a ShortText value.

Please note that unpadded variants should only be used when assumptions about the data can be made. In particular, if the length of the input is divisible by 3, then this is a safe function to call.

>>> _Base32Unpadded # "Sun"
"KN2W4"
>>> "KN2W4" ^? _Base32Unpadded
Just "Sun"

_Base32Hex :: Prism' ShortText ShortText Source #

A Prism into the Base32-hex encoding of a ShortText value.

>>> _Base32Hex # "Sun"
"ADQMS==="
>>> "ADQMS===" ^? _Base32Hex
Just "Sun"

_Base32HexUnpadded :: Prism' ShortText ShortText Source #

A Prism into the Base32-hex encoding of a ShortText value.

Please note that unpadded variants should only be used when assumptions about the data can be made. In particular, if the length of the input is divisible by 3, then this is a safe function to call.

>>> _Base32HexUnpadded # "Sun"
"ADQMS"
>>> "ADQMS" ^? _Base32HexUnpadded
Just "Sun"

Patterns

pattern Base32 :: ShortText -> ShortText Source #

Unidirectional pattern synonym for Base32-encoded ShortText values.

pattern Base32Unpadded :: ShortText -> ShortText Source #

Unidirectional pattern synonym for unpadded Base32-encoded ShortText values.

pattern Base32Hex :: ShortText -> ShortText Source #

Unidirectional pattern synonym for Base32hex-encoded ShortText values.

pattern Base32HexUnpadded :: ShortText -> ShortText Source #

Unidirectional pattern synonym for unpadded Base32hex-encoded ShortText values.