-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | print and show in unicode
--   
--   This package provides variants of <a>show</a> and <a>print</a>
--   functions that does not escape non-ascii characters.
--   
--   See <a>README</a> for usage.
--   
--   Run ghci with <tt>-interactive-print</tt> flag to print unicode
--   characters. See <a>Using a custom interactive printing function</a>
--   section in the GHC manual.
@package unicode-show
@version 0.1.0.2


-- | Provides a interactive printer for printing Unicode characters in ghci
--   REPL. Our design goal is that <a>uprint</a> produces String
--   representations that are valid Haskell <a>String</a> literals and uses
--   as many Unicode printable characters as possible. Hence
--   
--   <pre>
--   read . ushow == id
--   </pre>
--   
--   see the tests of this package for detailed specifications.
--   
--   <b>Example</b>
--   
--   With <a>print</a> :
--   
--   <pre>
--   $ <b>ghci</b>
--   ...
--   &gt; <b>["哈斯克尔7.6.1"]</b>
--   ["\21704\26031\20811\23572\&amp;7.6.1"]
--   &gt;
--   </pre>
--   
--   With <a>uprint</a> :
--   
--   <pre>
--   $ <b>ghci -interactive-print=Text.Show.Unicode.uprint Text.Show.Unicode</b>
--   ...
--   Ok, modules loaded: Text.Show.Unicode.
--   &gt; <b>("Хорошо!",["哈斯克尔7.6.1的力量","感じる"])</b>
--   ("Хорошо!",["哈斯克尔7.6.1的力量","感じる"])
--   &gt; "改\n行"
--   "改\n行"
--   </pre>
--   
--   You can make <a>uprint</a> the default interactive printer in several
--   ways. One is to <tt>cabal install unicode-show</tt>, and add the
--   following lines to your <tt>~/.ghci</tt> config file.
--   
--   <pre>
--   import qualified Text.Show.Unicode
--   :set -interactive-print=Text.Show.Unicode.uprint
--   </pre>
module Text.Show.Unicode

-- | Show the input, and then replace Haskell character literals with the
--   character it represents, for any Unicode printable characters except
--   backslash, single and double quotation marks. If something fails,
--   fallback to standard <a>show</a>.
ushow :: Show a => a -> String

-- | A version of <a>print</a> that uses <a>ushow</a>.
uprint :: Show a => a -> IO ()

-- | Show the input, and then replace character literals with the character
--   itself, for characters that satisfy the given predicate.
ushowWith :: Show a => (Char -> Bool) -> a -> String

-- | A version of <a>print</a> that uses <a>ushowWith</a>.
uprintWith :: Show a => (Char -> Bool) -> a -> IO ()
