| Copyright | (c) 2019-2026 Emily Pillmore |
|---|---|
| License | BSD-style |
| Maintainer | Emily Pillmore <emilypi@cohomolo.gy>, sofia-m-a <https://github.com/sofia-m-a> |
| Stability | stable |
| Portability | non-portable |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
Data.Base16.Types
Description
This module contains the opaque Base16 type and combinators for
working with Base16-encoded values.
Synopsis
- data Base16 a
- assertBase16 :: a -> Base16 a
- extractBase16 :: Base16 a -> a
Documentation
Wrap a value that is or is intended to be Base16-encoded.
Use the parseBase16 function in the corresponding ByteString or Text
module to validate external input. Encoding functions also produce this
wrapper. assertBase16 and the Functor, Applicative, and Monad
instances do not validate their results.
Instances
| Eq1 Base16 Source # | |
Defined in Data.Base16.Types | |
| Ord1 Base16 Source # | |
Defined in Data.Base16.Types Methods liftCompare :: (a -> b -> Ordering) -> Base16 a -> Base16 b -> Ordering | |
| Applicative Base16 Source # | |
| Functor Base16 Source # | |
| Monad Base16 Source # | |
| NFData a => NFData (Base16 a) Source # | |
Defined in Data.Base16.Types | |
| Show a => Show (Base16 a) Source # | |
| Eq a => Eq (Base16 a) Source # | |
| Ord a => Ord (Base16 a) Source # | |
assertBase16 :: a -> Base16 a Source #
Assert the provenance of a value.
For untrusted input, use the parseBase16 function in the corresponding
ByteString or Text module to validate it first.
Warning: This is a blind assertion that a particular value is base16 encoded in some alphabet. If you are not sure of the provenance of the value, you may experience odd behavior when attempting to decode. Use at your own risk. If I see any issues logged on this project from negligent use of this, Sofia and I will smite you.
extractBase16 :: Base16 a -> a Source #
Forget that a particular value is Base16-encoded