show-prettyprint alternatives and similar packages
Based on the "Text" category.
Alternatively, view show-prettyprint alternatives based on common mentions on social networks and blogs.
-
pandoc-citeproc
Library and executable for using citeproc with pandoc -
scholdoc
Fork of Pandoc for the implementation of a ScholarlyMarkdown parser -
prettyprinter
A modern, extensible and well-documented prettyprinter. -
blaze-from-html
A blazingly fast HTML combinator library for Haskell. -
skylighting
A Haskell syntax highlighting library with tokenizers derived from KDE syntax highlighting descriptions -
commonmark
Pure Haskell commonmark parsing library, designed to be flexible and extensible -
regex-genex
Given a list of regexes, generate all possible strings that matches all of them. -
text-offset
Emits code crossreference data for Haskell sources. -
regex-applicative
Regex-based parsing with an applicative interface -
pandoc-csv2table
A Pandoc filter that renders CSV as Pandoc Markdown Tables. -
pretty-show
Tools for working with derived Show instances in Haskell. -
servant-checked-exceptions
type-level errors for Servant APIs. -
double-conversion
A fast Haskell library for converting between double precision floating point numbers and text strings. It is implemented as a binding to the V8-derived C++ double-conversion library. -
text-format
A Haskell text formatting library optimized for ease of use and high performance. -
diagrams-pandoc
A pandoc filter to express diagrams inline using the haskell EDSL diagrams. -
boxes
A pretty-printing library for laying out text in two dimensions, using a simple box model. -
ghc-syntax-highlighter
Syntax highlighter for Haskell using the lexer of GHC
Clean code begins in your IDE with SonarLint
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of show-prettyprint or a related project?
README
Prettyprint Show
output
Output of nested data structures by Show
instances is often very hard to read.
This package offers a simple function to insert line breaks and indentation into
that ouput so that the semantics are unchanged, but makes it much easier to
read.
The package does not rely on a parser for actual Haskell; instead, it merely
reacts on parentheses, commas and the like. This makes it fairly robust even in
the face of invalid Show
instances, that may not produce valid Haskell code.
Examples
Artificial
Hello Foo ("(Bar", Haha) (Baz (A { foo = C, bar = D, qux = (E,"He)llo World!",G,
H,[A,B,c,d,e,Fghi]) } ) (B,C) [Baz A1 B2, (Baz A3 (B4)), (Baz A5 (B6)), (Baz
(A7) B8)]) (Foo) (Bar) (Baz (A) (B))
==>
Hello Foo ("(Bar",Haha)
(Baz (A {foo = C
,bar = D
,qux = (E,"He)llo World!",G,H,[A,B,c,d,e,Fghi])})
(B,C)
[Baz A1 B2,(Baz A3 (B4)),(Baz A5 (B6)),(Baz (A7) B8)])
(Foo)
(Bar)
(Baz (A) (B))
Inspired by a real AST
Set (fromList [(Name "A string with (parenthesis",Ann (Entry (Quality 1 1)
(Ann False) (Ann (Map [Ann (Bound (Ann (Id "lorem"))),Ann (Variable
(Ann (Id "ipsum")))])))),(Name "string",Ann (Entry (Quality 1 1) (Ann
True) (Ann (Internal (Ann (Reduce (Ann (Id "dolor")) (Ann (Id "sit")))))
))),(Name "Another } here",Ann (Entry (Quality 1 1) (Ann (Or [Ann (Not
(Ann (Is (Ann Flagged) (Ann Type) (Ann (Multi [Ann (Literal (Ann One))
]))))),Ann (Is (Ann Flagged) (Ann Type) (Ann (Multi [Ann (Literal (Ann
Three))]))),Ann (Is (Ann Flagged) (Ann Type) (Ann (Multi [Ann (Literal
(Ann Two))])))])) (Ann (Internal (Ann (Concat (Ann (Id "amet"))))))))])
==>
Set (fromList [(Name "A string with (parenthesis"
,Ann (Entry (Quality 1 1)
(Ann False)
(Ann (Map [Ann (Bound (Ann (Id "lorem")))
,Ann (Variable (Ann (Id "ipsum")))]))))
,(Name "string"
,Ann (Entry (Quality 1 1)
(Ann True)
(Ann (Internal (Ann (Reduce (Ann (Id "dolor"))
(Ann (Id "sit"))))))))
,(Name "Another } here"
,Ann (Entry (Quality 1 1)
(Ann (Or [Ann (Not (Ann (Is (Ann Flagged)
(Ann Type)
(Ann (Multi [Ann (Literal (Ann One))])))))
,Ann (Is (Ann Flagged)
(Ann Type)
(Ann (Multi [Ann (Literal (Ann Three))])))
,Ann (Is (Ann Flagged)
(Ann Type)
(Ann (Multi [Ann (Literal (Ann Two))])))]))
(Ann (Internal (Ann (Concat (Ann (Id "amet"))))))))])