From 1eeef8e14611d41d901d280cf4a55ebcd49ec4e1 Mon Sep 17 00:00:00 2001 From: Kian-Meng Ang Date: Sat, 3 Jan 2026 01:05:13 +0800 Subject: [PATCH 1/3] Fix typos Found via `codespell -H` --- README.md | 2 +- prettyprinter-convert-ansi-wl-pprint/README.md | 2 +- prettyprinter/app/GenerateReadme.hs | 2 +- prettyprinter/src/Prettyprinter.hs | 4 ++-- prettyprinter/src/Prettyprinter/Internal.hs | 12 ++++++------ .../src/Prettyprinter/Render/Util/StackMachine.hs | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index fe919bf6..f486a6ca 100644 --- a/README.md +++ b/README.md @@ -87,7 +87,7 @@ anymore. Text is not all letters and newlines. Often, we want to add more information, the simplest kind being some form of styling. An ANSI terminal supports -coloring, a web browser a plethora of different formattings. +coloring, a web browser a plethora of different formatting. More complex uses of annotations include e.g. adding type annotations for mouse-over hovers when printing a syntax tree, adding URLs to documentation, or diff --git a/prettyprinter-convert-ansi-wl-pprint/README.md b/prettyprinter-convert-ansi-wl-pprint/README.md index 32f5c0b7..1e353d43 100644 --- a/prettyprinter-convert-ansi-wl-pprint/README.md +++ b/prettyprinter-convert-ansi-wl-pprint/README.md @@ -6,7 +6,7 @@ the new `prettyprinter` one. Its purpose is making packages that only generate `ansi-wl-pprint` data available to the `prettyprinter` ecosystem. Note the difference to the `prettyprinter-compat-ansi-wl-pprint` module, which -does *not* convert any data, and instead provides an API that mimicks +does *not* convert any data, and instead provides an API that mimics `ansi-wl-pprint`, while secretly being `prettyprinter`-based behind the curtains. This package on the other hand does a proper conversion. diff --git a/prettyprinter/app/GenerateReadme.hs b/prettyprinter/app/GenerateReadme.hs index 079bd9de..b189821a 100644 --- a/prettyprinter/app/GenerateReadme.hs +++ b/prettyprinter/app/GenerateReadme.hs @@ -97,7 +97,7 @@ readmeContents = (mconcat . L.intersperse vspace) , paragraph [multiline| Text is not all letters and newlines. Often, we want to add more information, the simplest kind being some form of styling. An ANSI terminal supports coloring, a web browser a plethora of - different formattings. |] + different formatting. |] , paragraph [multiline| More complex uses of annotations include e.g. adding type annotations for mouse-over hovers when printing a syntax diff --git a/prettyprinter/src/Prettyprinter.hs b/prettyprinter/src/Prettyprinter.hs index bf44528e..bca592cc 100644 --- a/prettyprinter/src/Prettyprinter.hs +++ b/prettyprinter/src/Prettyprinter.hs @@ -180,7 +180,7 @@ -- -- /Modularity:/ To change the color of keywords later, you have to touch one -- point, namely the mapping in @'reAnnotateS'@, where @'Keyword'@ is mapped to --- 'Red'. If you have @'annotate Red …'@ everywher, you’ll have to do a full +-- 'Red'. If you have @'annotate Red …'@ everywhere, you’ll have to do a full -- text replacement, producing a large diff and touching lots of places for a -- very small change. -- @@ -224,7 +224,7 @@ module Prettyprinter ( -- * List functions -- | The 'sep' and 'cat' functions differ in one detail: when 'group'ed, the - -- 'sep's replace newlines wich 'space's, while the 'cat's simply remove + -- 'sep's replace newlines which 'space's, while the 'cat's simply remove -- them. If you're not sure what you want, start with the 'sep's. concatWith, diff --git a/prettyprinter/src/Prettyprinter/Internal.hs b/prettyprinter/src/Prettyprinter/Internal.hs index 27f02c8d..f2c20c31 100755 --- a/prettyprinter/src/Prettyprinter/Internal.hs +++ b/prettyprinter/src/Prettyprinter/Internal.hs @@ -858,7 +858,7 @@ indent i d = hang i (spaces i <> d) -- list [1,20,300,4000] -- -- If there is not enough space, then the input is split into lines entry-wise --- therwise they are laid out vertically, with separators put in the front: +-- otherwise they are laid out vertically, with separators put in the front: -- -- >>> putDocW 10 doc -- list [1 @@ -1364,7 +1364,7 @@ annotate = Annotated -- @ -- -- it should not be used without caution, for each invocation traverses the --- entire contained document. If possible, it is preferrable to unannotate after +-- entire contained document. If possible, it is preferable to unannotate after -- producing the layout by using 'unAnnotateS'. unAnnotate :: Doc ann -> Doc xxx unAnnotate = alterAnnotations (const []) @@ -1375,7 +1375,7 @@ unAnnotate = alterAnnotations (const []) -- generally annotated document. -- -- Since this traverses the entire @'Doc'@ tree, including parts that are not --- rendered due to other layouts fitting better, it is preferrable to reannotate +-- rendered due to other layouts fitting better, it is preferable to reannotate -- after producing the layout by using @'reAnnotateS'@. -- -- Since @'reAnnotate'@ has the right type and satisfies @'reAnnotate id = id'@, @@ -1396,7 +1396,7 @@ reAnnotate re = alterAnnotations (pure . re) -- not vice-versa. -- -- Since this traverses the entire @'Doc'@ tree, including parts that are not --- rendered due to other layouts fitting better, it is preferrable to reannotate +-- rendered due to other layouts fitting better, it is preferable to reannotate -- after producing the layout by using @'alterAnnotationsS'@. alterAnnotations :: (ann -> [ann']) -> Doc ann -> Doc ann' alterAnnotations re = go @@ -1871,7 +1871,7 @@ layoutPretty (LayoutOptions Unbounded) = layoutUnbounded -- |------------------------| -- -- Note that this exceeds the desired 26 character page width. The same --- document, rendered with @'layoutSmart'@, fits the layout contstraints: +-- document, rendered with @'layoutSmart'@, fits the layout constraints: -- -- >>> go layoutSmart doc -- |------------------------| @@ -1986,7 +1986,7 @@ layoutWadlerLeijen where -- * current column >= current nesting level - -- * current column - current indentaion = number of chars inserted in line + -- * current column - current indentation = number of chars inserted in line best :: Int -- Current nesting level -> Int -- Current column, i.e. "where the cursor is" diff --git a/prettyprinter/src/Prettyprinter/Render/Util/StackMachine.hs b/prettyprinter/src/Prettyprinter/Render/Util/StackMachine.hs index 054001a9..5ecb5fe0 100644 --- a/prettyprinter/src/Prettyprinter/Render/Util/StackMachine.hs +++ b/prettyprinter/src/Prettyprinter/Render/Util/StackMachine.hs @@ -163,6 +163,6 @@ unsafePeekStyle = StackMachine (\styles -> case styles of writeOutput :: output -> StackMachine output style () writeOutput w = StackMachine (\styles -> ((), w, styles)) --- | Run the renderer and retrive the writing end +-- | Run the renderer and retrieve the writing end execStackMachine :: [styles] -> StackMachine output styles a -> (output, [styles]) execStackMachine styles (StackMachine r) = let (_, w, s) = r styles in (w, s) From 29a376a2500ebcfe476fd978e5096097e843add9 Mon Sep 17 00:00:00 2001 From: Ang Date: Wed, 4 Feb 2026 23:43:22 +0800 Subject: [PATCH 2/3] Update prettyprinter/app/GenerateReadme.hs Co-authored-by: Simon Jakobi --- prettyprinter/app/GenerateReadme.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prettyprinter/app/GenerateReadme.hs b/prettyprinter/app/GenerateReadme.hs index b189821a..fa4238d1 100644 --- a/prettyprinter/app/GenerateReadme.hs +++ b/prettyprinter/app/GenerateReadme.hs @@ -97,7 +97,7 @@ readmeContents = (mconcat . L.intersperse vspace) , paragraph [multiline| Text is not all letters and newlines. Often, we want to add more information, the simplest kind being some form of styling. An ANSI terminal supports coloring, a web browser a plethora of - different formatting. |] + different formatting options. |] , paragraph [multiline| More complex uses of annotations include e.g. adding type annotations for mouse-over hovers when printing a syntax From e28b5268de737c7c49e0bee8402ae58cd4c1adf5 Mon Sep 17 00:00:00 2001 From: Ang Date: Wed, 4 Feb 2026 23:43:29 +0800 Subject: [PATCH 3/3] Update README.md Co-authored-by: Simon Jakobi --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f486a6ca..9aaa7da6 100644 --- a/README.md +++ b/README.md @@ -87,7 +87,7 @@ anymore. Text is not all letters and newlines. Often, we want to add more information, the simplest kind being some form of styling. An ANSI terminal supports -coloring, a web browser a plethora of different formatting. +coloring, a web browser a plethora of different formatting options. More complex uses of annotations include e.g. adding type annotations for mouse-over hovers when printing a syntax tree, adding URLs to documentation, or