| Copyright | © 2020 IOHK |
|---|---|
| License | Apache-2.0 |
| Safe Haskell | None |
| Language | Haskell2010 |
Codec.Binary.Bech32.TH
Contents
Description
This module contains Template-Haskell-specific extensions to the Bech32 library.
Synopsis
Quasi-Quotation Support
humanReadablePart :: QuasiQuoter Source #
A quasiquoter for Bech32 human-readable prefixes.
This quasiquoter makes it possible to construct values of type
HumanReadablePart at compile time, using string literals.
Failure to parse a string literal will result in a compile-time error.
See HumanReadablePartError for the set of possible
errors that can be raised.
Example:
>>>:set -XQuasiQuotes>>>import Codec.Binary.Bech32>>>import Codec.Binary.Bech32.TH>>>let addrPrefix = [humanReadablePart|addr|]>>>addrPrefixHumanReadablePart "addr">>>:t addrPrefixaddrPrefix :: HumanReadablePart