Data.Bytes.Builder.Class

bytebuild-0.3.16.3: Build byte arrays

Safe Haskell | None
Language | Haskell2010

Data.Bytes.Builder.Class

Synopsis

- class ToBuilder a where
  - toBuilder :: a -> Builder

# Documentation

class ToBuilder a where #

Types that can be encoded as a builder. Human-readable encodings are used when possible. For example, numbers are encoded an ascii-encoded decimal characters. UTF-8 is preferred for textual types. For types that represent arbitrary bytes (e.g. Bytes, ByteString), the bytes are preserved.

The goal of this typeclass is to reduce the size of builders produced by quasiquotation.

Methods

toBuilder :: a -> Builder #

#### Instances

Instances details

ToBuilder ByteArray # | Uses `byteArray`
Instance details Defined in Data.Bytes.Builder.Class Methods toBuilder :: ByteArray -> Builder #
ToBuilder Builder # | Identity
Instance details Defined in Data.Bytes.Builder.Class Methods toBuilder :: Builder -> Builder #
ToBuilder Bytes # | Uses `bytes`.
Instance details Defined in Data.Bytes.Builder.Class Methods toBuilder :: Bytes -> Builder #
ToBuilder ShortByteString # | Uses `shortByteString`
Instance details Defined in Data.Bytes.Builder.Class Methods toBuilder :: ShortByteString -> Builder #
ToBuilder Int16 # | Uses `int16Dec`.
Instance details Defined in Data.Bytes.Builder.Class Methods toBuilder :: Int16 -> Builder #
ToBuilder Int32 # | Uses `int32Dec`.
Instance details Defined in Data.Bytes.Builder.Class Methods toBuilder :: Int32 -> Builder #
ToBuilder Int64 # | Uses `int64Dec`.
Instance details Defined in Data.Bytes.Builder.Class Methods toBuilder :: Int64 -> Builder #
ToBuilder Int8 # | Uses `int8Dec`.
Instance details Defined in Data.Bytes.Builder.Class Methods toBuilder :: Int8 -> Builder #
ToBuilder Word16 # | Uses `word16Dec`.
Instance details Defined in Data.Bytes.Builder.Class Methods toBuilder :: Word16 -> Builder #
ToBuilder Word32 # | Uses `word32Dec`.
Instance details Defined in Data.Bytes.Builder.Class Methods toBuilder :: Word32 -> Builder #
ToBuilder Word64 # | Uses `word64Dec`.
Instance details Defined in Data.Bytes.Builder.Class Methods toBuilder :: Word64 -> Builder #
ToBuilder Word8 # | Uses `word8Dec`.
Instance details Defined in Data.Bytes.Builder.Class Methods toBuilder :: Word8 -> Builder #
ToBuilder ShortText # | Uses `shortTextUtf8`.
Instance details Defined in Data.Bytes.Builder.Class Methods toBuilder :: ShortText -> Builder #
ToBuilder String # | Uses `stringUtf8`
Instance details Defined in Data.Bytes.Builder.Class Methods toBuilder :: String -> Builder #
ToBuilder Double # | uses `doubleDec`
Instance details Defined in Data.Bytes.Builder.Class Methods toBuilder :: Double -> Builder #
ToBuilder Int # | Uses `intDec`.
Instance details Defined in Data.Bytes.Builder.Class Methods toBuilder :: Int -> Builder #
ToBuilder Word # | Uses `wordDec`.
Instance details Defined in Data.Bytes.Builder.Class Methods toBuilder :: Word -> Builder #