unescaping-print: Tiny package providing unescaping versions of show and print

[ bsd3, library, text ] [ Propose Tags ]

This package solves the problem of escaping all "non-printable" symbols by the standard show function. It provides the ushow and uprint functions which replace show and print from Prelude. The function uprint is intended to be used as custom printing function in GHCi (with the -interactive-print option).


[Skip to Readme]
Versions [faq] 0.1
Change log ChangeLog.md
Dependencies base (>=4.10 && <4.13) [details]
License BSD-3-Clause
Author Vitaly Bragilevsky
Maintainer Vitaly Bragilevsky <vit.bragilevsky@gmail.com>
Revised Revision 1 made by bravit at Fri Dec 21 15:25:33 UTC 2018
Category Text
Home page https://github.com/bravit/unescaping-print#readme
Bug tracker https://github.com/bravit/unescaping-print/issues
Source repo head: git clone https://github.com/bravit/unescaping-print
Uploaded by bravit at Sun Sep 23 23:57:59 UTC 2018
Distributions NixOS:0.1
Downloads 164 total (14 in the last 30 days)
Rating (no votes yet) [estimated by rule of succession]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs available [build log]
Last success reported on 2018-09-24 [all 1 reports]

Modules

[Index] [Quick Jump]

Downloads

Note: This package has metadata revisions in the cabal description newer than included in the tarball. To unpack the package including the revisions, use 'cabal get'.

Maintainer's Corner

For package maintainers and hackage trustees


Readme for unescaping-print-0.1

[back to package description]

This package provides the replacement for the show and print functions which escape "non-printable" characters including every character with the ASCII code greater than 127. It is intended to be used with GHCi's -interactive-print option:

GHCi> :set -interactive-print=UnescapingPrint.uprint
GHCi> "Съешь ещё этих мягких французских булок, да выпей чаю"
"Съешь ещё этих мягких французских булок, да выпей чаю"
GHCi> "Vogt Nyx: »Büß du ja zwölf Qirsch, Kämpe!«"
"Vogt Nyx: »Büß du ja zwölf Qirsch, Kämpe!«"
GHCi> "Dès Noël où un zéphyr haï me vêt de glaçons würmiens je dîne d’exquis rôtis de bœuf au kir à l’aÿ d’âge mûr & cætera"
"Dès Noël où un zéphyr haï me vêt de glaçons würmiens je dîne d’exquis rôtis de bœuf au kir à l’aÿ d’âge mûr & cætera"

This approach works for (almost) any type with Show instance:

GHCi> (Just "Привет, ", 'м','и','р') 
(Just "Привет, ",'м','и','р')

This change could be made persistent via $HOME/.ghci file.