base16-lens: Optics for the Base16 library

[ bsd3, data, library ] [ Propose Tags ]

Prisms and pattern synonyms for the Base16 library


[Skip to Readme]
Versions [faq] 0.1.0.0, 0.1.1.0
Change log CHANGELOG.md
Dependencies base (>=4.10 && <5), base16 (>=0.1.3 && <0.2), bytestring (==0.10.*), lens (>=4.0 && <5), text (==1.2.*) [details]
License BSD-3-Clause
Copyright (c) 2020 Emily Pillmore
Author Emily Pillmore
Maintainer emilypi@cohomolo.gy
Category Data
Home page https://github.com/emilypi/base16-lens
Bug tracker https://github.com/emilypi/base16-lens/issues
Source repo head: git clone https://github.com/emilypi/base16.git
Uploaded by topos at Thu Mar 26 16:33:23 UTC 2020
Distributions NixOS:0.1.1.0
Downloads 120 total (82 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-03-26 [all 1 reports]

Modules

[Index] [Quick Jump]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees


Readme for base16-lens-0.1.1.0

[back to package description]

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
-- and
pattern Hex :: 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

-- 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.