pretty-simple 2.0.2.0 → 2.0.2.1
raw patch · 4 files changed
+88/−2 lines, 4 filesdep ~basedep ~textnew-component:exe:pretty-simple
Dependency ranges changed: base, text
Files
- CHANGELOG.md +32/−0
- README.md +1/−1
- app/Main.hs +35/−0
- pretty-simple.cabal +20/−1
CHANGELOG.md view
@@ -1,4 +1,36 @@ +## 2.0.2.1++* Add a small command-line program that will pretty print anything from stdin+ called `pretty-print`. It can be installed to `~/.local/bin` if you enable+ the flag `buildexe` like so:++ ```sh+ $ stack install pretty-simple-2.0.1.1 --flag pretty-simple:buildexe+ ```++ When you run it, you can paste something you want formatted on stdin, then+ press <key>Ctrl</key>-<key>D</key>. It will print the formatted version on+ stdout:++ ```sh+ $ pretty-simple+ [(Just 3, Just 4)]++ ^D++ [+ ( Just 3+ , Just 4+ )+ ]+ ```++## 2.0.2.0++* Fix a [problem](https://github.com/cdepillabout/pretty-simple/pull/20) with+ the pTraceShow functions not working correctly.+ ## 2.0.1.0 * Added the `Debug.Pretty.Simple` that exports functions that work like
README.md view
@@ -77,7 +77,7 @@ - It is possible to print without color by using the [`pPrintNoColor`](https://hackage.haskell.org/package/pretty-simple/docs/Text-Pretty-Simple.html#v:pPrintNoColor) function.-- Rainbox Parentheses+- Rainbow Parentheses - Easy to understand deeply nested data types. - Configurable Indentation - Amount of indentation is configurable with the
+ app/Main.hs view
@@ -0,0 +1,35 @@+module Main where++-- This is a small executable that will pretty-print anything from stdin.+-- It can be installed to `~/.local/bin` if you enable the flag `buildexe` like so:+--+-- @+-- $ stack install pretty-simple-2.0.1.1 --flag pretty-simple:buildexe+-- @+--+-- When you run it, you can paste something you want formatted on stdin, then+-- press @Ctrl-D@. It will print the formatted version on stdout:+--+-- @+-- $ pretty-simple+-- [(Just 3, Just 4)]+--+-- ^D+--+-- [+-- ( Just 3+-- , Just 4+-- )+-- ]+-- @++import Data.Text (unpack)+import qualified Data.Text.IO as T+import qualified Data.Text.Lazy.IO as LT+import Text.Pretty.Simple (pString)++main :: IO ()+main = do+ input <- T.getContents+ let output = pString $ unpack input+ LT.putStr output
pretty-simple.cabal view
@@ -1,5 +1,5 @@ name: pretty-simple-version: 2.0.2.0+version: 2.0.2.1 synopsis: pretty printer for data types with a 'Show' instance. description: Please see <https://github.com/cdepillabout/pretty-simple#readme README.md>. homepage: https://github.com/cdepillabout/pretty-simple@@ -15,6 +15,10 @@ , img/pretty-simple-example-screenshot.png cabal-version: >=1.10 +flag buildexe+ description: Build an small command line program that pretty-print anything from stdin.+ default: False+ flag buildexample description: Build a small example program showing how to use the pPrint function default: False@@ -40,6 +44,21 @@ default-language: Haskell2010 ghc-options: -Wall other-extensions: TemplateHaskell++executable pretty-simple+ main-is: Main.hs+ hs-source-dirs: app+ build-depends: base+ , pretty-simple+ , text+ default-language: Haskell2010+ ghc-options: -Wall -threaded -rtsopts -with-rtsopts=-N++ if flag(buildexe)+ buildable: True+ else+ buildable: False+ executable pretty-simple-example main-is: Example.hs