### Pretty Printer Output Variations Source: https://github.com/haskell-prettyprinter/prettyprinter/blob/master/prettyprinter/README.md Illustrates the output of the pretty printer for different format widths. The first example shows the output for a wide format, and the second shows the output for a narrow format. ```haskell -- Output for wide enough formats: example :: Int -> Bool -> Char -> IO () -- Output for narrow formats: example :: Int -> Bool -> Char -> IO () ``` -------------------------------- ### ansi-wl-pprint to prettyprinter Conversion Diagram Source: https://github.com/haskell-prettyprinter/prettyprinter/blob/master/prettyprinter-convert-ansi-wl-pprint/README.md Illustrates the conversion flow between ansi-wl-pprint documents and prettyprinter's AnsiStyle documents using fromAnsiWlPprint and toAnsiWlPprint functions. ```text ╭────────────────────╮ fromAnsiWlPprint ╭────────────────────╮ │ Doc ├───────────────────────▷│ Doc AnsiStyle │ │ (ansi-wl-pprint) │◁───────────────────────┤ (prettyprinter) │ ╰────────────────────╯ toAnsiWlPprint ╰────────────────────╯ ``` -------------------------------- ### Pretty Printing a Function Signature Source: https://github.com/haskell-prettyprinter/prettyprinter/blob/master/prettyprinter/README.md This snippet demonstrates how to pretty print a function signature using align, sep, and zipWith. It shows how the output adapts to different format widths. ```haskell let prettyType = align . sep . zipWith (<+>) ("::" : repeat "->") prettySig name ty = pretty name <+> prettyType ty in prettySig "example" ["Int", "Bool", "Char", "IO ()"] ``` -------------------------------- ### Old encloseSep behavior vs. new Source: https://github.com/haskell-prettyprinter/prettyprinter/blob/master/prettyprinter/CHANGELOG.md Illustrates the change in `encloseSep` behavior where the old version included an `align` wrapper, while the new version does not. ```haskell encloseSep_old … = align (encloseSep_new …) ``` -------------------------------- ### Prettyprinting a Function Signature Source: https://github.com/haskell-prettyprinter/prettyprinter/blob/master/README.md This snippet demonstrates how to prettyprint a function signature using alignment and separators. It shows the output for both wide and narrow formats. ```haskell let prettyType = align . sep . zipWith (<+>) (":" : repeat "->") prettySig name ty = pretty name <+> prettyType ty in prettySig "example" ["Int", "Bool", "Char", "IO ()" ] ``` ```haskell -- Output for wide enough formats: example :: Int -> Bool -> Char -> IO () -- Output for narrow formats: example :: Int -> Bool -> Char -> IO () ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.