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


-- | Efficient interpolation for Prettyprinter
--   
--   This package provides efficient interpolation of
--   <tt><a>string-interpolate</a></tt> quasi quoters when used with
--   <tt><a>prettyprinter</a></tt>.
@package prettyprinter-interp
@version 0.2.0.0


-- | <h1>Efficient interpolation for <a>Prettyprinter</a></h1>
--   
--   This module provides efficient interpolation of
--   <a><tt>string-interpolate</tt></a> quasi quoters when used with
--   <a><tt>prettyprinter</tt>s</a> <a>Doc</a>uments.
--   
--   The normal quasi quoters from <tt>string-interpolate</tt> do work when
--   used as a <tt>Doc</tt>. Newlines are even converted to
--   <tt>Prettyprinter.</tt><a>line</a>. However, this method is
--   inefficient. The following code functions correctly:
--   
--   <pre>
--   {-# LANGUAGE OverloadedStrings #-}
--   {-# LANGUAGE QuasiQuotes #-}
--   
--   module Main where
--   
--   import Data.String.Interpolate
--   import Data.Text (Text)
--   import Prettyprinter
--   
--   f :: <a>Text</a>
--   f = "world"
--   
--   g :: Doc ()
--   g = [<a>i</a>|Hello #{f}!|]
--   
--   main :: IO ()
--   main = print g
--   
--   </pre>
--   
--   However, what happens under the hood is that <tt>f</tt> is converted
--   to <a>String</a>, the interpolated string is built manipulating
--   <tt>String</tt>s, and then the output is converted to <a>Text</a> in
--   <a><tt>prettyprinter</tt></a>. The following code is much better:
--   
--   <pre>
--   g = <a>pretty</a> ([i|Hello #{f}!|] :: Text)
--   
--   </pre>
--   
--   Now, the interpolated string is constructed as <tt>Text</tt>, and this
--   is passed cleanly into <tt>Doc</tt> which also uses <tt>Text</tt> as
--   its underlying type for representation of text. At no point is
--   <tt>f</tt> converted to <tt>String</tt>, and the string construction
--   benefits from the performance of <tt>Text</tt>. And again, newlines
--   are converted to <a>line</a>.
--   
--   This module defines wrapper quasi quoters that automatically perform
--   the <tt>pretty</tt> invocation, and can simply be used as:
--   
--   <pre>
--   g = [<a>di</a>|Hello #{f}!|]
--   
--   </pre>
module Prettyprinter.Interpolate

-- | Wrapper around the <a>i</a> quasi quoter, producing a <a>Doc</a>
--   
--   Newlines in the text are converted to <a>line</a>.
di :: QuasiQuoter

-- | Wrapper around the <a>__i</a> quasi quoter, producing a <a>Doc</a>
--   
--   Newlines in the text are converted to <a>line</a>.
__di :: QuasiQuoter

-- | Wrapper around the <a>iii</a> quasi quoter, producing a <a>Doc</a>
--   
--   Newlines in the text are converted to <a>line</a>.
diii :: QuasiQuoter

-- | Wrapper around the <a>__i'E</a> quasi quoter, producing a <a>Doc</a>
--   
--   Newlines in the text are converted to <a>line</a>.
__di'E :: QuasiQuoter

-- | Wrapper around the <a>__i'L</a> quasi quoter, producing a <a>Doc</a>
--   
--   Newlines in the text are converted to <a>line</a>.
__di'L :: QuasiQuoter

-- | Wrapper around the <a>iii'E</a> quasi quoter, producing a <a>Doc</a>
--   
--   Newlines in the text are converted to <a>line</a>.
diii'E :: QuasiQuoter

-- | Wrapper around the <a>iii'L</a> quasi quoter, producing a <a>Doc</a>
--   
--   Newlines in the text are converted to <a>line</a>.
diii'L :: QuasiQuoter

-- | <i>Deprecated: <a>d__i'E</a> is a deprecated alias for <a>__di'E</a>
--   and will be removed in prettyprinter-interp 0.3</i>
d__i'E :: QuasiQuoter

-- | <i>Deprecated: <a>d__i'L</a> is a deprecated alias for <a>__di'L</a>
--   and will be removed in prettyprinter-interp 0.3</i>
d__i'L :: QuasiQuoter
