-- 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.git#string-interpolate
-- for more info.
@package string-interpolate
@version 0.1.0.0
module Data.String.Interpolate.Conversion
-- | We wrap the builders in B so that we can add a phantom type parameter.
-- This gives the inner interpolates enough information to know
-- where they're going and pick an instance, forcing all the types into
-- lockstep.
newtype B dst a
B :: a -> B dst a
[unB] :: B dst a -> a
-- | 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)
-- | 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 (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
module Data.String.Interpolate
i :: QuasiQuoter