module Codec.Encryption.OpenPGP.Types.Internal.PrettyUtils where
import qualified Data.ByteString as B
import qualified Data.ByteString.Lazy as BL
import Data.Text.Encoding (decodeUtf8With)
import Data.Text.Encoding.Error (lenientDecode)
import Prettyprinter (Doc, Pretty(..))
prettyBS :: B.ByteString -> Doc ann
prettyBS :: forall ann. ByteString -> Doc ann
prettyBS = Text -> Doc ann
forall ann. Text -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty (Text -> Doc ann) -> (ByteString -> Text) -> ByteString -> Doc ann
forall b c a. (b -> c) -> (a -> b) -> a -> c
. OnDecodeError -> ByteString -> Text
decodeUtf8With OnDecodeError
lenientDecode
prettyLBS :: BL.ByteString -> Doc ann
prettyLBS :: forall ann. ByteString -> Doc ann
prettyLBS = Text -> Doc ann
forall ann. Text -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty (Text -> Doc ann) -> (ByteString -> Text) -> ByteString -> Doc ann
forall b c a. (b -> c) -> (a -> b) -> a -> c
. OnDecodeError -> ByteString -> Text
decodeUtf8With OnDecodeError
lenientDecode (ByteString -> Text)
-> (ByteString -> ByteString) -> ByteString -> Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ByteString -> ByteString
BL.toStrict