-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Haskell string/text/bytestring interpolation that just works -- -- Unicode-aware string interpolation that handles all textual types. -- -- See the README at -- https://gitlab.com/williamyaoh/string-interpolate/blob/master/README.md -- for more info. @package string-interpolate @version 0.2.0.2 module Data.String.Interpolate.Conversion -- | Does this type require special behavior when something is interpolated -- into it? type family IsCustomSink dst -- | Something that can be interpolated into. class IsCustomSink dst ~ flag => InterpSink (flag :: Bool) dst where { type family Builder flag dst :: *; } -- | Meant to be used only for verbatim parts of the interpolation. ofString :: InterpSink flag dst => Proxy flag -> String -> B dst (Builder flag dst) -- | build should be 'in-order'; that is, the left builder comes -- from a string on the left, and the right builder comes from a string -- on the right. build :: InterpSink flag dst => Proxy flag -> B dst (Builder flag dst) -> B dst (Builder flag dst) -> B dst (Builder flag dst) finalize :: InterpSink flag dst => Proxy flag -> B dst (Builder flag dst) -> dst -- | Represents that we can interpolate objects of type src into a an -- interpolation string that returns type dst. class InterpSink flag dst => Interpolatable (flag :: Bool) src dst interpolate :: Interpolatable flag src dst => Proxy flag -> src -> B dst (Builder flag dst) -- | We can collapse whitespace in the given type. class SpaceChompable a chompSpaces :: SpaceChompable a => a -> a -- | Convert a strict ByteString into a Text Builder, converting any -- invalid characters into the Unicode replacement character � (U+FFFD). bsToTextBuilder :: ByteString -> Builder -- | Convert a lazy ByteString into a Text Builder, converting any -- invalid characters into the Unicode replacement character � (U+FFFD). lbsToTextBuilder :: ByteString -> Builder -- | Data.ByteString.Builder provides charUtf8 to do this, -- but it doesn't correctly handle invalid characters. encodeCharUTF8 :: Char -> Builder instance GHC.Show.Show a => GHC.Show.Show (Data.String.Interpolate.Conversion.B dst a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Data.String.Interpolate.Conversion.B dst a) instance Data.String.Interpolate.Conversion.SpaceChompable Data.ByteString.Internal.ByteString instance Data.String.Interpolate.Conversion.SpaceChompable Data.ByteString.Lazy.Internal.ByteString instance (GHC.Show.Show a, Data.String.IsString a) => Data.String.Interpolate.Conversion.SpaceChompable a instance Data.String.Interpolate.Conversion.SpaceChompable GHC.Base.String instance Data.String.Interpolate.Conversion.SpaceChompable Data.Text.Internal.Text instance Data.String.Interpolate.Conversion.SpaceChompable Data.Text.Internal.Lazy.Text instance (GHC.Show.Show src, Data.String.IsString dst, Data.String.Interpolate.Conversion.IsCustomSink dst Data.Type.Equality.~ 'GHC.Types.False) => Data.String.Interpolate.Conversion.Interpolatable 'GHC.Types.False src dst instance (Data.String.IsString dst, Data.String.Interpolate.Conversion.IsCustomSink dst Data.Type.Equality.~ 'GHC.Types.False) => Data.String.Interpolate.Conversion.Interpolatable 'GHC.Types.False GHC.Types.Char dst instance (Data.String.IsString dst, Data.String.Interpolate.Conversion.IsCustomSink dst Data.Type.Equality.~ 'GHC.Types.False) => Data.String.Interpolate.Conversion.Interpolatable 'GHC.Types.False GHC.Base.String dst instance (Data.String.IsString dst, Data.String.Interpolate.Conversion.IsCustomSink dst Data.Type.Equality.~ 'GHC.Types.False) => Data.String.Interpolate.Conversion.Interpolatable 'GHC.Types.False Data.Text.Internal.Text dst instance (Data.String.IsString dst, Data.String.Interpolate.Conversion.IsCustomSink dst Data.Type.Equality.~ 'GHC.Types.False) => Data.String.Interpolate.Conversion.Interpolatable 'GHC.Types.False Data.Text.Internal.Lazy.Text dst instance (Data.String.IsString dst, Data.String.Interpolate.Conversion.IsCustomSink dst Data.Type.Equality.~ 'GHC.Types.False) => Data.String.Interpolate.Conversion.Interpolatable 'GHC.Types.False Data.Text.Internal.Builder.Builder dst instance (Data.String.IsString dst, Data.String.Interpolate.Conversion.IsCustomSink dst Data.Type.Equality.~ 'GHC.Types.False) => Data.String.Interpolate.Conversion.Interpolatable 'GHC.Types.False Data.ByteString.Internal.ByteString dst instance (Data.String.IsString dst, Data.String.Interpolate.Conversion.IsCustomSink dst Data.Type.Equality.~ 'GHC.Types.False) => Data.String.Interpolate.Conversion.Interpolatable 'GHC.Types.False Data.ByteString.Lazy.Internal.ByteString dst instance (Data.String.IsString dst, Data.String.Interpolate.Conversion.IsCustomSink dst Data.Type.Equality.~ 'GHC.Types.False) => Data.String.Interpolate.Conversion.Interpolatable 'GHC.Types.False Data.ByteString.Builder.Internal.Builder dst instance GHC.Show.Show src => Data.String.Interpolate.Conversion.Interpolatable 'GHC.Types.True src Data.Text.Internal.Text instance Data.String.Interpolate.Conversion.Interpolatable 'GHC.Types.True GHC.Types.Char Data.Text.Internal.Text instance Data.String.Interpolate.Conversion.Interpolatable 'GHC.Types.True GHC.Base.String Data.Text.Internal.Text instance Data.String.Interpolate.Conversion.Interpolatable 'GHC.Types.True Data.Text.Internal.Text Data.Text.Internal.Text instance Data.String.Interpolate.Conversion.Interpolatable 'GHC.Types.True Data.Text.Internal.Lazy.Text Data.Text.Internal.Text instance Data.String.Interpolate.Conversion.Interpolatable 'GHC.Types.True Data.Text.Internal.Builder.Builder Data.Text.Internal.Text instance Data.String.Interpolate.Conversion.Interpolatable 'GHC.Types.True Data.ByteString.Internal.ByteString Data.Text.Internal.Text instance Data.String.Interpolate.Conversion.Interpolatable 'GHC.Types.True Data.ByteString.Lazy.Internal.ByteString Data.Text.Internal.Text instance Data.String.Interpolate.Conversion.Interpolatable 'GHC.Types.True Data.ByteString.Builder.Internal.Builder Data.Text.Internal.Text instance GHC.Show.Show src => Data.String.Interpolate.Conversion.Interpolatable 'GHC.Types.True src Data.Text.Internal.Lazy.Text instance Data.String.Interpolate.Conversion.Interpolatable 'GHC.Types.True GHC.Types.Char Data.Text.Internal.Lazy.Text instance Data.String.Interpolate.Conversion.Interpolatable 'GHC.Types.True GHC.Base.String Data.Text.Internal.Lazy.Text instance Data.String.Interpolate.Conversion.Interpolatable 'GHC.Types.True Data.Text.Internal.Text Data.Text.Internal.Lazy.Text instance Data.String.Interpolate.Conversion.Interpolatable 'GHC.Types.True Data.Text.Internal.Lazy.Text Data.Text.Internal.Lazy.Text instance Data.String.Interpolate.Conversion.Interpolatable 'GHC.Types.True Data.Text.Internal.Builder.Builder Data.Text.Internal.Lazy.Text instance Data.String.Interpolate.Conversion.Interpolatable 'GHC.Types.True Data.ByteString.Internal.ByteString Data.Text.Internal.Lazy.Text instance Data.String.Interpolate.Conversion.Interpolatable 'GHC.Types.True Data.ByteString.Lazy.Internal.ByteString Data.Text.Internal.Lazy.Text instance Data.String.Interpolate.Conversion.Interpolatable 'GHC.Types.True Data.ByteString.Builder.Internal.Builder Data.Text.Internal.Lazy.Text instance GHC.Show.Show src => Data.String.Interpolate.Conversion.Interpolatable 'GHC.Types.True src Data.Text.Internal.Builder.Builder instance Data.String.Interpolate.Conversion.Interpolatable 'GHC.Types.True GHC.Types.Char Data.Text.Internal.Builder.Builder instance Data.String.Interpolate.Conversion.Interpolatable 'GHC.Types.True GHC.Base.String Data.Text.Internal.Builder.Builder instance Data.String.Interpolate.Conversion.Interpolatable 'GHC.Types.True Data.Text.Internal.Text Data.Text.Internal.Builder.Builder instance Data.String.Interpolate.Conversion.Interpolatable 'GHC.Types.True Data.Text.Internal.Lazy.Text Data.Text.Internal.Builder.Builder instance Data.String.Interpolate.Conversion.Interpolatable 'GHC.Types.True Data.Text.Internal.Builder.Builder Data.Text.Internal.Builder.Builder instance Data.String.Interpolate.Conversion.Interpolatable 'GHC.Types.True Data.ByteString.Internal.ByteString Data.Text.Internal.Builder.Builder instance Data.String.Interpolate.Conversion.Interpolatable 'GHC.Types.True Data.ByteString.Lazy.Internal.ByteString Data.Text.Internal.Builder.Builder instance Data.String.Interpolate.Conversion.Interpolatable 'GHC.Types.True Data.ByteString.Builder.Internal.Builder Data.Text.Internal.Builder.Builder instance GHC.Show.Show src => Data.String.Interpolate.Conversion.Interpolatable 'GHC.Types.True src Data.ByteString.Internal.ByteString instance Data.String.Interpolate.Conversion.Interpolatable 'GHC.Types.True GHC.Types.Char Data.ByteString.Internal.ByteString instance Data.String.Interpolate.Conversion.Interpolatable 'GHC.Types.True GHC.Base.String Data.ByteString.Internal.ByteString instance Data.String.Interpolate.Conversion.Interpolatable 'GHC.Types.True Data.Text.Internal.Text Data.ByteString.Internal.ByteString instance Data.String.Interpolate.Conversion.Interpolatable 'GHC.Types.True Data.Text.Internal.Lazy.Text Data.ByteString.Internal.ByteString instance Data.String.Interpolate.Conversion.Interpolatable 'GHC.Types.True Data.Text.Internal.Builder.Builder Data.ByteString.Internal.ByteString instance Data.String.Interpolate.Conversion.Interpolatable 'GHC.Types.True Data.ByteString.Internal.ByteString Data.ByteString.Internal.ByteString instance Data.String.Interpolate.Conversion.Interpolatable 'GHC.Types.True Data.ByteString.Lazy.Internal.ByteString Data.ByteString.Internal.ByteString instance Data.String.Interpolate.Conversion.Interpolatable 'GHC.Types.True Data.ByteString.Builder.Internal.Builder Data.ByteString.Internal.ByteString instance GHC.Show.Show src => Data.String.Interpolate.Conversion.Interpolatable 'GHC.Types.True src Data.ByteString.Lazy.Internal.ByteString instance Data.String.Interpolate.Conversion.Interpolatable 'GHC.Types.True GHC.Types.Char Data.ByteString.Lazy.Internal.ByteString instance Data.String.Interpolate.Conversion.Interpolatable 'GHC.Types.True GHC.Base.String Data.ByteString.Lazy.Internal.ByteString instance Data.String.Interpolate.Conversion.Interpolatable 'GHC.Types.True Data.Text.Internal.Text Data.ByteString.Lazy.Internal.ByteString instance Data.String.Interpolate.Conversion.Interpolatable 'GHC.Types.True Data.Text.Internal.Lazy.Text Data.ByteString.Lazy.Internal.ByteString instance Data.String.Interpolate.Conversion.Interpolatable 'GHC.Types.True Data.Text.Internal.Builder.Builder Data.ByteString.Lazy.Internal.ByteString instance Data.String.Interpolate.Conversion.Interpolatable 'GHC.Types.True Data.ByteString.Internal.ByteString Data.ByteString.Lazy.Internal.ByteString instance Data.String.Interpolate.Conversion.Interpolatable 'GHC.Types.True Data.ByteString.Lazy.Internal.ByteString Data.ByteString.Lazy.Internal.ByteString instance Data.String.Interpolate.Conversion.Interpolatable 'GHC.Types.True Data.ByteString.Builder.Internal.Builder Data.ByteString.Lazy.Internal.ByteString instance GHC.Show.Show src => Data.String.Interpolate.Conversion.Interpolatable 'GHC.Types.True src Data.ByteString.Builder.Internal.Builder instance Data.String.Interpolate.Conversion.Interpolatable 'GHC.Types.True GHC.Types.Char Data.ByteString.Builder.Internal.Builder instance Data.String.Interpolate.Conversion.Interpolatable 'GHC.Types.True GHC.Base.String Data.ByteString.Builder.Internal.Builder instance Data.String.Interpolate.Conversion.Interpolatable 'GHC.Types.True Data.Text.Internal.Text Data.ByteString.Builder.Internal.Builder instance Data.String.Interpolate.Conversion.Interpolatable 'GHC.Types.True Data.Text.Internal.Lazy.Text Data.ByteString.Builder.Internal.Builder instance Data.String.Interpolate.Conversion.Interpolatable 'GHC.Types.True Data.Text.Internal.Builder.Builder Data.ByteString.Builder.Internal.Builder instance Data.String.Interpolate.Conversion.Interpolatable 'GHC.Types.True Data.ByteString.Internal.ByteString Data.ByteString.Builder.Internal.Builder instance Data.String.Interpolate.Conversion.Interpolatable 'GHC.Types.True Data.ByteString.Lazy.Internal.ByteString Data.ByteString.Builder.Internal.Builder instance Data.String.Interpolate.Conversion.Interpolatable 'GHC.Types.True Data.ByteString.Builder.Internal.Builder Data.ByteString.Builder.Internal.Builder instance (Data.String.Interpolate.Conversion.IsCustomSink str Data.Type.Equality.~ 'GHC.Types.False, Data.String.IsString str) => Data.String.Interpolate.Conversion.InterpSink 'GHC.Types.False str instance Data.String.Interpolate.Conversion.InterpSink 'GHC.Types.True Data.Text.Internal.Text instance Data.String.Interpolate.Conversion.InterpSink 'GHC.Types.True Data.Text.Internal.Lazy.Text instance Data.String.Interpolate.Conversion.InterpSink 'GHC.Types.True Data.Text.Internal.Builder.Builder instance Data.String.Interpolate.Conversion.InterpSink 'GHC.Types.True Data.ByteString.Internal.ByteString instance Data.String.Interpolate.Conversion.InterpSink 'GHC.Types.True Data.ByteString.Lazy.Internal.ByteString instance Data.String.Interpolate.Conversion.InterpSink 'GHC.Types.True Data.ByteString.Builder.Internal.Builder -- | This module provides two quasiquoters, i and iii, -- which: -- -- -- -- i leaves newlines and whitespace intact as they are in the -- source code, while iii collapses newlines/whitespace into -- single spaces, stripping leading/trailing whitespace as well. -- -- As an example, -- --
--   {-# LANGUAGE OverloadedStrings #-}
--   
--   import Data.Text
--   import Data.String.Interpolate ( i )
--   
--   λ> age = 33 :: Int
--   λ> name = "Tatiana" :: Text
--   λ> [i|{"name": "#{name}", "age": #{age}}|] :: String
--   >>> "{\"name\": \"Tatiana\", \"age\": 33}"
--   
--   λ> [i|
--   Name: #{name}
--   Age: #{age}
--   |] :: String
--   >>> "\nName: Tatiana\nAge: 33\n"
--   
-- -- See the README at -- https://gitlab.com/williamyaoh/string-interpolate/blob/master/README.md -- for more details and examples. module Data.String.Interpolate i :: QuasiQuoter iii :: QuasiQuoter