base32-lens: Optics for the Base32 library

[ bsd3, data, library ] [ Propose Tags ]

Prisms and pattern synonyms for the Base32 library

[Skip to Readme]
Versions [RSS] [faq],,
Change log
Dependencies base (>=4.10 && <5), base32 (>=0.1 && <0.3), bytestring (==0.10.*), lens (>=4.0 && <5), text (==1.2.*) [details]
License BSD-3-Clause
Copyright (c) 2020 Emily Pillmore
Author Emily Pillmore
Revised Revision 1 made by topos at 2020-07-22T15:29:53Z
Category Data
Home page
Bug tracker
Source repo head: git clone
Uploaded by topos at 2020-02-16T18:07:38Z
Distributions LTSHaskell:, NixOS:, Stackage:
Downloads 440 total (15 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs available [build log]
Last success reported on 2020-02-16 [all 1 reports]


[Index] [Quick Jump]


Note: This package has metadata revisions in the cabal description newer than included in the tarball. To unpack the package including the revisions, use 'cabal get'.

Maintainer's Corner

For package maintainers and hackage trustees


Readme for base32-lens-

[back to package description]


Build Status Hackage

This package provides optics and convenient pattern synonyms for the base32 library.


The pattern synonyms provided in this library are:

pattern Base32 :: ByteString -> ByteString
pattern Base32Url :: ByteString -> ByteString
pattern Base32UrlUnpadded :: ByteString -> ByteString

-- and

pattern Base32 :: Text -> Text
pattern Base32Url :: Text -> Text
pattern Base32UrlUnpadded :: Text -> Text

These provide a convenient high level interface for passing Base32 encoded values.


Prisms for encoding and decoding Text and ByteString values are given as part of the library:

_Base32 :: Prism' ByteString ByteString
_Base32Url :: Prism' ByteString ByteString
_Base32UrlUnpadded :: Prism' ByteString ByteString

-- and

_Base32 :: Prism' Text Text
_Base32Url :: Prism' Text Text
_Base32UrlUnpadded :: Prism' Text Text

If a particular structure has a Lens into some Text or ByteString value they might want to encode (or decode), then composing such a Lens with these Prisms yields an affine Traversal, resulting in a structure which has the focus of its Lens encoded as or decoded from Base32(-url).