HORIZON HASKELLDocslts/ghc-10.0.xfc4e5982026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 10.0.0.20260917 · lts/ghc-10.0.x · fc4e598 · 2026-10-11

Modulepgp-wordlist-0.1.0.3Haskell2010

Data.Text.PgpWordlist.Internal.Convert

Core functionality for conversion between binary formats and PGP word lists.

  • 9 values
valuetoText :: ByteString -> Text
#

Inverse of fromText, modulo whitespace count.

Example1 expression
toText (BSL.pack [104, 101, 108, 108, 111])"frighten glossary glucose handiwork gremlin"

Convert a text of whitespace-separated words to their binary representation. The whitespace splitting behaviour is given by words.

Example1 expression
fromText (T.pack "frighten glossary glucose handiwork gremlin")Right "hello"

Invalid words are recognized:

Example1 expression
fromText (T.pack "frighten dragon glucose handiwork gremlin")Left (BadWord "dragon")

Typical mistakes include accidentally swapping numbers, which leads to a parity error:

Example1 expression
fromText (T.pack "frighten glucose glossary handiwork gremlin")Left (BadParity "glucose" 108)