BSD-3-Clause licensed by Emily Pillmore
Maintained by emilypi@cohomolo.gy
This version can be pinned in stack with:base16-lens-0.1.2.0@sha256:975af64c1a7d602b187addd48e640b119a7364c061750f580837f0932b45d62a,1705

Module documentation for 0.1.2.0

Base16-lens

Build Status Hackage

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

Patterns

The pattern synonyms provided in this library are:

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

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

Optics

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

_Hex :: Prism' ByteString ByteString
_Base16 :: Prism' ByteString ByteString
_Base16Lenient :: Iso' ByteString ByteString
-- and
_Hex:: Prism' Text Text
_Base16 :: Prism' Text Text
_Base16Lenient :: Iso' 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.

Changes

Revision history for base64-lens

0.1.2.0

  • Add lenient isos and patterns

0.1.1.0

  • Add lazy optics + patterns

0.1.0.0

  • First version. Released on an unsuspecting world.