Data.Bytes.Builder.Bounded.Class

bytebuild-0.3.16.3: Build byte arrays

Safe Haskell | None
Language | Haskell2010

Data.Bytes.Builder.Bounded.Class

Synopsis

- class ToBoundedBuilder a where
  - type BoundedBuilderLength a :: Nat
  - toBuilder :: a -> Builder (BoundedBuilderLength a)

# Documentation

class ToBoundedBuilder a where #

Variant of To 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.

Associated Types

type BoundedBuilderLength a :: Nat #

Methods

toBuilder :: a -> Builder (BoundedBuilderLength a) #

#### Instances

Instances details

ToBoundedBuilder Int16 # | Uses `int16Dec`.
Instance details Defined in Data.Bytes.Builder.Bounded.Class Associated Types
type BoundedBuilderLength Int16 |
Instance details Defined in Data.Bytes.Builder.Bounded.Class type BoundedBuilderLength Int16 = 6
Methods toBuilder :: Int16 -> Builder (BoundedBuilderLength Int16) #
ToBoundedBuilder Int32 # | Uses `int32Dec`.
Instance details Defined in Data.Bytes.Builder.Bounded.Class Associated Types
type BoundedBuilderLength Int32 |
Instance details Defined in Data.Bytes.Builder.Bounded.Class type BoundedBuilderLength Int32 = 11
Methods toBuilder :: Int32 -> Builder (BoundedBuilderLength Int32) #
ToBoundedBuilder Int64 # | Uses `int64Dec`.
Instance details Defined in Data.Bytes.Builder.Bounded.Class Associated Types
type BoundedBuilderLength Int64 |
Instance details Defined in Data.Bytes.Builder.Bounded.Class type BoundedBuilderLength Int64 = 20
Methods toBuilder :: Int64 -> Builder (BoundedBuilderLength Int64) #
ToBoundedBuilder Int8 # | Uses `int8Dec`.
Instance details Defined in Data.Bytes.Builder.Bounded.Class Associated Types
type BoundedBuilderLength Int8 |
Instance details Defined in Data.Bytes.Builder.Bounded.Class type BoundedBuilderLength Int8 = 4
Methods toBuilder :: Int8 -> Builder (BoundedBuilderLength Int8) #
ToBoundedBuilder Word16 # | Uses `word16Dec`.
Instance details Defined in Data.Bytes.Builder.Bounded.Class Associated Types
type BoundedBuilderLength Word16 |
Instance details Defined in Data.Bytes.Builder.Bounded.Class type BoundedBuilderLength Word16 = 5
Methods toBuilder :: Word16 -> Builder (BoundedBuilderLength Word16) #
ToBoundedBuilder Word32 # | Uses `word32Dec`.
Instance details Defined in Data.Bytes.Builder.Bounded.Class Associated Types
type BoundedBuilderLength Word32 |
Instance details Defined in Data.Bytes.Builder.Bounded.Class type BoundedBuilderLength Word32 = 10
Methods toBuilder :: Word32 -> Builder (BoundedBuilderLength Word32) #
ToBoundedBuilder Word64 # | Uses `word64Dec`.
Instance details Defined in Data.Bytes.Builder.Bounded.Class Associated Types
type BoundedBuilderLength Word64 |
Instance details Defined in Data.Bytes.Builder.Bounded.Class type BoundedBuilderLength Word64 = 19
Methods toBuilder :: Word64 -> Builder (BoundedBuilderLength Word64) #
ToBoundedBuilder Word8 # | Uses `word8Dec`.
Instance details Defined in Data.Bytes.Builder.Bounded.Class Associated Types
type BoundedBuilderLength Word8 |
Instance details Defined in Data.Bytes.Builder.Bounded.Class type BoundedBuilderLength Word8 = 3
Methods toBuilder :: Word8 -> Builder (BoundedBuilderLength Word8) #
ToBoundedBuilder Int # | Uses `intDec`.
Instance details Defined in Data.Bytes.Builder.Bounded.Class Associated Types
type BoundedBuilderLength Int |
Instance details Defined in Data.Bytes.Builder.Bounded.Class type BoundedBuilderLength Int = 20
Methods toBuilder :: Int -> Builder (BoundedBuilderLength Int) #
ToBoundedBuilder Word # | Uses `wordDec`.
Instance details Defined in Data.Bytes.Builder.Bounded.Class Associated Types
type BoundedBuilderLength Word |
Instance details Defined in Data.Bytes.Builder.Bounded.Class type BoundedBuilderLength Word = 19
Methods toBuilder :: Word -> Builder (BoundedBuilderLength Word) #
ToBoundedBuilder (Builder n) # | Identity
Instance details Defined in Data.Bytes.Builder.Bounded.Class Associated Types
type BoundedBuilderLength (Builder n) |
Instance details Defined in Data.Bytes.Builder.Bounded.Class type BoundedBuilderLength (Builder n) = n
Methods toBuilder :: Builder n -> Builder (BoundedBuilderLength (Builder n)) #