-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | String interpolation done right -- @package interpolate @version 0.1.0 module Data.String.Interpolate.Util -- | Remove indentation as much as possible while preserving relative -- indentation levels. -- -- unindent is useful in combination with i to remove -- leading spaces that resulted from code indentation. That way you can -- freely indent your string literals without the indentation ending up -- in the resulting strings. -- -- Here is an example: -- --
-- >>> :set -XQuasiQuotes
--
-- >>> import Data.String.Interpolate
--
-- >>> import Data.String.Interpolate.Util
--
-- >>> :{
-- putStr $ unindent [i|
-- def foo
-- 23
-- end
-- |]
-- :}
-- def foo
-- 23
-- end
--
--
-- To allow this, two additional things are being done, apart from
-- removing indentation:
--
--
-- >>> let name = "Marvin"
--
-- >>> putStrLn [i|name: #{name}|]
-- name: Marvin
--
--
-- or integers
--
--
-- >>> let age = 23
--
-- >>> putStrLn [i|age: #{age}|]
-- age: 23
--
--
-- or arbitrary Haskell expressions
--
--
-- >>> let profession = "\955-scientist"
--
-- >>> putStrLn [i|profession: #{unwords [name, "the", profession]}|]
-- profession: Marvin the λ-scientist
--
i :: QuasiQuoter
module Data.String.Interpolate.IsString
-- | Like i, but constructs a value of type
--
-- -- IsString a => a --i :: QuasiQuoter