Optics for the Base16 library

Version on this page:
Stackage Nightly 2020-04-08:
Latest on Hackage:

See all snapshots base16-lens appears in

BSD-3-Clause licensed by Emily Pillmore
Maintained by [email protected]

Module documentation for

This version can be pinned in stack with:[email protected]:4b014394917dd4249eded163549719026dca2e8fe137cff3cdc024dac9accaca,1551


Build Status Hackage

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


The pattern synonyms provided in this library are:

pattern Hex :: ByteString -> ByteString
-- and
pattern Hex :: Text -> Text

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


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

_Hex :: Prism' ByteString ByteString

-- and

_Hex:: 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 Base16.


Revision history for base64-lens

  • First version. Released on an unsuspecting world.