cooked-validators-4.0.0
Safe HaskellSafe-Inferred
LanguageHaskell2010

Cooked.Pretty.Common

Description

This module provides common functions to help implement pretty-printers in cooked-validators

Synopsis

Documentation

type DocCooked = Doc () Source #

renderString :: (a -> DocCooked) -> a -> String Source #

Use this to convert a pretty-printer to a regular show function using default layout options. This is used in Testing because Tasty uses strings.

prettyItemize :: DocCooked -> DocCooked -> [DocCooked] -> DocCooked Source #

Print an item list with a title.

>>> prettyItemize "Foo" "-" ["bar1", "bar2", "bar3"]
Foo
  - bar1
  - bar2
  - bar3

prettyHash :: PrettyCookedHashOpts -> BuiltinByteString -> DocCooked Source #

Pretty print a prefix of a hash with a given length.