-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Edge of developments for "text-builder" -- -- This is a development version of "text-builder". All experimentation -- and feature development happens here. The API can change drastically. -- For a more stable API use "text-builder", which is now just a wrapper -- over this package. @package text-builder-dev @version 0.3 module TextBuilderDev -- | Specification of how to efficiently construct strict Text. -- Provides instances of Semigroup and Monoid, which have -- complexity of O(1). data TextBuilder -- | Execute a builder producing a strict text buildText :: TextBuilder -> Text -- | Get the amount of characters length :: TextBuilder -> Int -- | Check whether the builder is empty null :: TextBuilder -> Bool -- | Put builder, to stdout putToStdOut :: TextBuilder -> IO () -- | Put builder, to stderr putToStdErr :: TextBuilder -> IO () -- | Put builder, followed by a line, to stdout putLnToStdOut :: TextBuilder -> IO () -- | Put builder, followed by a line, to stderr putLnToStdErr :: TextBuilder -> IO () -- | Evidence that there exists an unambiguous way to convert a type to and -- from TextBuilder. -- -- Unlike typical conversion classes this class is lawful. The law is: -- --
-- a == "fromTextBuilder" ("toTextBuilder" a)
--
--
-- This class does not provide implicit rendering, such as from integer
-- to its decimal representation. It should already be evident that there
-- is multiple ways of how an integer can be represented in a textual
-- form (e.g., hexadecimal). The non-ambiguity is further enforced by the
-- presence of the inverse conversion. In the integer case there is no
-- way to read it from a textual form without a possibility of failing.
-- So that is enough to prove that it's not sufficient.
--
-- If you're looking for such conversion classes, this library is not a
-- place for them, since there can be infinite amount of flavours of
-- conversions. IOW, they are context-dependent and as such should be
-- defined as part of the domain.
class IsomorphicToTextBuilder a
toTextBuilder :: IsomorphicToTextBuilder a => a -> TextBuilder
fromTextBuilder :: IsomorphicToTextBuilder a => TextBuilder -> a
-- | Run the builder and pack the produced text into a new builder.
--
-- Useful to have around builders that you reuse, because a forced
-- builder is much faster, since it's virtually a single call
-- memcopy.
force :: TextBuilder -> TextBuilder
-- | Intercalate builders
intercalate :: Foldable foldable => TextBuilder -> foldable TextBuilder -> TextBuilder
-- | Pad a builder from the left side to the specified length with the
-- specified character
padFromLeft :: Int -> Char -> TextBuilder -> TextBuilder
-- | Pad a builder from the right side to the specified length with the
-- specified character
padFromRight :: Int -> Char -> TextBuilder -> TextBuilder
-- | Strict text
text :: Text -> TextBuilder
-- | String
string :: String -> TextBuilder
-- | ASCII byte string
asciiByteString :: ByteString -> TextBuilder
-- | Hexadecimal readable representation of binary data.
hexData :: ByteString -> TextBuilder
-- | Unicode character
char :: Char -> TextBuilder
-- | Unicode code point
unicodeCodePoint :: Int -> TextBuilder
-- | Single code-unit UTF-16 character
utf16CodeUnits1 :: Word16 -> TextBuilder
-- | Double code-unit UTF-16 character
utf16CodeUnits2 :: Word16 -> Word16 -> TextBuilder
-- | Single code-unit UTF-8 character
utf8CodeUnits1 :: Word8 -> TextBuilder
-- | Double code-unit UTF-8 character
utf8CodeUnits2 :: Word8 -> Word8 -> TextBuilder
-- | Triple code-unit UTF-8 character
utf8CodeUnits3 :: Word8 -> Word8 -> Word8 -> TextBuilder
-- | UTF-8 character out of 4 code units
utf8CodeUnits4 :: Word8 -> Word8 -> Word8 -> Word8 -> TextBuilder
-- | Decimal representation of an integral value
decimal :: Integral a => a -> TextBuilder
-- | Decimal representation of an unsigned integral value
unsignedDecimal :: Integral a => a -> TextBuilder
-- | Decimal representation of an integral value with thousands separated
-- by the specified character
thousandSeparatedDecimal :: Integral a => Char -> a -> TextBuilder
-- | Decimal representation of an unsigned integral value with thousands
-- separated by the specified character
thousandSeparatedUnsignedDecimal :: Integral a => Char -> a -> TextBuilder
-- | Data size in decimal notation over amount of bytes.
dataSizeInBytesInDecimal :: Integral a => Char -> a -> TextBuilder
-- | Unsigned binary number
unsignedBinary :: Integral a => a -> TextBuilder
-- | Unsigned binary number
unsignedPaddedBinary :: (Integral a, FiniteBits a) => a -> TextBuilder
-- | Hexadecimal representation of an integral value
hexadecimal :: Integral a => a -> TextBuilder
-- | Unsigned hexadecimal representation of an integral value
unsignedHexadecimal :: Integral a => a -> TextBuilder
-- | Decimal digit
decimalDigit :: Integral a => a -> TextBuilder
-- | Hexadecimal digit
hexadecimalDigit :: Integral a => a -> TextBuilder
-- | Double with a fixed number of decimal places.
fixedDouble :: Int -> Double -> TextBuilder
-- | Double multiplied by 100 with a fixed number of decimal places applied
-- and followed by a percent-sign.
doublePercent :: Int -> Double -> TextBuilder
-- | General template for formatting date values according to the ISO8601
-- standard. The format is the following:
--
-- -- 2021-11-24T12:11:02Z ---- -- Integrations with various time-libraries can be easily derived from -- that. utcTimestampInIso8601 :: Int -> Int -> Int -> Int -> Int -> Int -> TextBuilder -- | Time interval in seconds. Directly applicable to DiffTime and -- NominalDiffTime. intervalInSeconds :: RealFrac seconds => seconds -> TextBuilder instance TextBuilderDev.IsomorphicToTextBuilder TextBuilderDev.TextBuilder instance TextBuilderDev.IsomorphicToTextBuilder Data.Text.Internal.Text instance TextBuilderDev.IsomorphicToTextBuilder GHC.Base.String instance TextBuilderDev.IsomorphicToTextBuilder Data.Text.Internal.Lazy.Text instance TextBuilderDev.IsomorphicToTextBuilder Data.Text.Internal.Builder.Builder instance GHC.Base.Semigroup TextBuilderDev.TextBuilder instance GHC.Base.Monoid TextBuilderDev.TextBuilder instance Data.String.IsString TextBuilderDev.TextBuilder instance GHC.Show.Show TextBuilderDev.TextBuilder