bytestring-conversion-0.3.2: Type-classes to convert values to and from ByteString.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.ByteString.Conversion

Synopsis

Documentation

class ToByteString a where Source #

Methods

builder :: a -> Builder Source #

Instances

Instances details
ToByteString Int16 Source # 
Instance details

Defined in Data.ByteString.Conversion.To

ToByteString Int32 Source # 
Instance details

Defined in Data.ByteString.Conversion.To

ToByteString Int64 Source # 
Instance details

Defined in Data.ByteString.Conversion.To

ToByteString Int8 Source # 
Instance details

Defined in Data.ByteString.Conversion.To

Methods

builder :: Int8 -> Builder Source #

ToByteString Word16 Source # 
Instance details

Defined in Data.ByteString.Conversion.To

ToByteString Word32 Source # 
Instance details

Defined in Data.ByteString.Conversion.To

ToByteString Word64 Source # 
Instance details

Defined in Data.ByteString.Conversion.To

ToByteString Word8 Source # 
Instance details

Defined in Data.ByteString.Conversion.To

ToByteString Builder Source # 
Instance details

Defined in Data.ByteString.Conversion.To

ToByteString ByteString Source # 
Instance details

Defined in Data.ByteString.Conversion.To

ToByteString ByteString Source # 
Instance details

Defined in Data.ByteString.Conversion.To

ToByteString Text Source # 
Instance details

Defined in Data.ByteString.Conversion.To

Methods

builder :: Text -> Builder Source #

ToByteString Text Source # 
Instance details

Defined in Data.ByteString.Conversion.To

Methods

builder :: Text -> Builder Source #

ToByteString Integer Source # 
Instance details

Defined in Data.ByteString.Conversion.To

ToByteString Bool Source # 
Instance details

Defined in Data.ByteString.Conversion.To

Methods

builder :: Bool -> Builder Source #

ToByteString Char Source # 
Instance details

Defined in Data.ByteString.Conversion.To

Methods

builder :: Char -> Builder Source #

ToByteString Double Source # 
Instance details

Defined in Data.ByteString.Conversion.To

ToByteString Float Source # 
Instance details

Defined in Data.ByteString.Conversion.To

ToByteString Int Source # 
Instance details

Defined in Data.ByteString.Conversion.To

Methods

builder :: Int -> Builder Source #

ToByteString Word Source # 
Instance details

Defined in Data.ByteString.Conversion.To

Methods

builder :: Word -> Builder Source #

ToByteString (Hex Int16) Source # 
Instance details

Defined in Data.ByteString.Conversion.To

ToByteString (Hex Int32) Source # 
Instance details

Defined in Data.ByteString.Conversion.To

ToByteString (Hex Int64) Source # 
Instance details

Defined in Data.ByteString.Conversion.To

ToByteString (Hex Int8) Source # 
Instance details

Defined in Data.ByteString.Conversion.To

ToByteString (Hex Word16) Source # 
Instance details

Defined in Data.ByteString.Conversion.To

ToByteString (Hex Word32) Source # 
Instance details

Defined in Data.ByteString.Conversion.To

ToByteString (Hex Word64) Source # 
Instance details

Defined in Data.ByteString.Conversion.To

ToByteString (Hex Word8) Source # 
Instance details

Defined in Data.ByteString.Conversion.To

ToByteString (Hex Int) Source # 
Instance details

Defined in Data.ByteString.Conversion.To

Methods

builder :: Hex Int -> Builder Source #

ToByteString (Hex Word) Source # 
Instance details

Defined in Data.ByteString.Conversion.To

ToByteString a => ToByteString (List a) Source # 
Instance details

Defined in Data.ByteString.Conversion.To

Methods

builder :: List a -> Builder Source #

ToByteString a => ToByteString (CI a) Source # 
Instance details

Defined in Data.ByteString.Conversion.To

Methods

builder :: CI a -> Builder Source #

ToByteString [Char] Source # 
Instance details

Defined in Data.ByteString.Conversion.To

Methods

builder :: [Char] -> Builder Source #

class FromByteString a where Source #

Parse ByteStrings.

Methods

parser :: Parser a Source #

Instances

Instances details
FromByteString Int16 Source # 
Instance details

Defined in Data.ByteString.Conversion.From

Methods

parser :: Parser Int16 Source #

FromByteString Int32 Source # 
Instance details

Defined in Data.ByteString.Conversion.From

Methods

parser :: Parser Int32 Source #

FromByteString Int64 Source # 
Instance details

Defined in Data.ByteString.Conversion.From

Methods

parser :: Parser Int64 Source #

FromByteString Int8 Source # 
Instance details

Defined in Data.ByteString.Conversion.From

Methods

parser :: Parser Int8 Source #

FromByteString Word16 Source # 
Instance details

Defined in Data.ByteString.Conversion.From

Methods

parser :: Parser Word16 Source #

FromByteString Word32 Source # 
Instance details

Defined in Data.ByteString.Conversion.From

Methods

parser :: Parser Word32 Source #

FromByteString Word64 Source # 
Instance details

Defined in Data.ByteString.Conversion.From

Methods

parser :: Parser Word64 Source #

FromByteString Word8 Source # 
Instance details

Defined in Data.ByteString.Conversion.From

Methods

parser :: Parser Word8 Source #

FromByteString ByteString Source # 
Instance details

Defined in Data.ByteString.Conversion.From

Methods

parser :: Parser ByteString Source #

FromByteString ByteString Source # 
Instance details

Defined in Data.ByteString.Conversion.From

Methods

parser :: Parser ByteString Source #

FromByteString Text Source #

UTF-8 is assumed as encoding format.

Instance details

Defined in Data.ByteString.Conversion.From

Methods

parser :: Parser Text Source #

FromByteString Text Source #

UTF-8 is assumed as encoding format.

Instance details

Defined in Data.ByteString.Conversion.From

Methods

parser :: Parser Text Source #

FromByteString Integer Source # 
Instance details

Defined in Data.ByteString.Conversion.From

Methods

parser :: Parser Integer Source #

FromByteString Bool Source # 
Instance details

Defined in Data.ByteString.Conversion.From

Methods

parser :: Parser Bool Source #

FromByteString Char Source #

UTF-8 is assumed as encoding format.

Instance details

Defined in Data.ByteString.Conversion.From

Methods

parser :: Parser Char Source #

FromByteString Double Source # 
Instance details

Defined in Data.ByteString.Conversion.From

Methods

parser :: Parser Double Source #

FromByteString Int Source # 
Instance details

Defined in Data.ByteString.Conversion.From

Methods

parser :: Parser Int Source #

FromByteString Word Source # 
Instance details

Defined in Data.ByteString.Conversion.From

Methods

parser :: Parser Word Source #

(Integral a, Bits a) => FromByteString (Hex a) Source # 
Instance details

Defined in Data.ByteString.Conversion.From

Methods

parser :: Parser (Hex a) Source #

FromByteString a => FromByteString (List a) Source #

A (flat) comma-separated list of values without spaces.

Instance details

Defined in Data.ByteString.Conversion.From

Methods

parser :: Parser (List a) Source #

(FoldCase a, FromByteString a) => FromByteString (CI a) Source # 
Instance details

Defined in Data.ByteString.Conversion.From

Methods

parser :: Parser (CI a) Source #

FromByteString [Char] Source #

UTF-8 is assumed as encoding format.

Instance details

Defined in Data.ByteString.Conversion.From

Methods

parser :: Parser [Char] Source #

newtype Hex a Source #

Newtype wrapper to parse and produce integral numbers in hexadecimal format

Constructors

Hex 

Fields

Instances

Instances details
Bits a => Bits (Hex a) Source # 
Instance details

Defined in Data.ByteString.Conversion.Internal

Methods

(.&.) :: Hex a -> Hex a -> Hex a #

(.|.) :: Hex a -> Hex a -> Hex a #

xor :: Hex a -> Hex a -> Hex a #

complement :: Hex a -> Hex a #

shift :: Hex a -> Int -> Hex a #

rotate :: Hex a -> Int -> Hex a #

zeroBits :: Hex a #

bit :: Int -> Hex a #

setBit :: Hex a -> Int -> Hex a #

clearBit :: Hex a -> Int -> Hex a #

complementBit :: Hex a -> Int -> Hex a #

testBit :: Hex a -> Int -> Bool #

bitSizeMaybe :: Hex a -> Maybe Int #

bitSize :: Hex a -> Int #

isSigned :: Hex a -> Bool #

shiftL :: Hex a -> Int -> Hex a #

unsafeShiftL :: Hex a -> Int -> Hex a #

shiftR :: Hex a -> Int -> Hex a #

unsafeShiftR :: Hex a -> Int -> Hex a #

rotateL :: Hex a -> Int -> Hex a #

rotateR :: Hex a -> Int -> Hex a #

popCount :: Hex a -> Int #

Bounded a => Bounded (Hex a) Source # 
Instance details

Defined in Data.ByteString.Conversion.Internal

Methods

minBound :: Hex a #

maxBound :: Hex a #

Enum a => Enum (Hex a) Source # 
Instance details

Defined in Data.ByteString.Conversion.Internal

Methods

succ :: Hex a -> Hex a #

pred :: Hex a -> Hex a #

toEnum :: Int -> Hex a #

fromEnum :: Hex a -> Int #

enumFrom :: Hex a -> [Hex a] #

enumFromThen :: Hex a -> Hex a -> [Hex a] #

enumFromTo :: Hex a -> Hex a -> [Hex a] #

enumFromThenTo :: Hex a -> Hex a -> Hex a -> [Hex a] #

Num a => Num (Hex a) Source # 
Instance details

Defined in Data.ByteString.Conversion.Internal

Methods

(+) :: Hex a -> Hex a -> Hex a #

(-) :: Hex a -> Hex a -> Hex a #

(*) :: Hex a -> Hex a -> Hex a #

negate :: Hex a -> Hex a #

abs :: Hex a -> Hex a #

signum :: Hex a -> Hex a #

fromInteger :: Integer -> Hex a #

Read a => Read (Hex a) Source # 
Instance details

Defined in Data.ByteString.Conversion.Internal

Integral a => Integral (Hex a) Source # 
Instance details

Defined in Data.ByteString.Conversion.Internal

Methods

quot :: Hex a -> Hex a -> Hex a #

rem :: Hex a -> Hex a -> Hex a #

div :: Hex a -> Hex a -> Hex a #

mod :: Hex a -> Hex a -> Hex a #

quotRem :: Hex a -> Hex a -> (Hex a, Hex a) #

divMod :: Hex a -> Hex a -> (Hex a, Hex a) #

toInteger :: Hex a -> Integer #

Real a => Real (Hex a) Source # 
Instance details

Defined in Data.ByteString.Conversion.Internal

Methods

toRational :: Hex a -> Rational #

Show a => Show (Hex a) Source # 
Instance details

Defined in Data.ByteString.Conversion.Internal

Methods

showsPrec :: Int -> Hex a -> ShowS #

show :: Hex a -> String #

showList :: [Hex a] -> ShowS #

PrintfArg a => PrintfArg (Hex a) Source # 
Instance details

Defined in Data.ByteString.Conversion.Internal

(Integral a, Bits a) => FromByteString (Hex a) Source # 
Instance details

Defined in Data.ByteString.Conversion.From

Methods

parser :: Parser (Hex a) Source #

ToByteString (Hex Int16) Source # 
Instance details

Defined in Data.ByteString.Conversion.To

ToByteString (Hex Int32) Source # 
Instance details

Defined in Data.ByteString.Conversion.To

ToByteString (Hex Int64) Source # 
Instance details

Defined in Data.ByteString.Conversion.To

ToByteString (Hex Int8) Source # 
Instance details

Defined in Data.ByteString.Conversion.To

ToByteString (Hex Word16) Source # 
Instance details

Defined in Data.ByteString.Conversion.To

ToByteString (Hex Word32) Source # 
Instance details

Defined in Data.ByteString.Conversion.To

ToByteString (Hex Word64) Source # 
Instance details

Defined in Data.ByteString.Conversion.To

ToByteString (Hex Word8) Source # 
Instance details

Defined in Data.ByteString.Conversion.To

ToByteString (Hex Int) Source # 
Instance details

Defined in Data.ByteString.Conversion.To

Methods

builder :: Hex Int -> Builder Source #

ToByteString (Hex Word) Source # 
Instance details

Defined in Data.ByteString.Conversion.To

Eq a => Eq (Hex a) Source # 
Instance details

Defined in Data.ByteString.Conversion.Internal

Methods

(==) :: Hex a -> Hex a -> Bool #

(/=) :: Hex a -> Hex a -> Bool #

Ord a => Ord (Hex a) Source # 
Instance details

Defined in Data.ByteString.Conversion.Internal

Methods

compare :: Hex a -> Hex a -> Ordering #

(<) :: Hex a -> Hex a -> Bool #

(<=) :: Hex a -> Hex a -> Bool #

(>) :: Hex a -> Hex a -> Bool #

(>=) :: Hex a -> Hex a -> Bool #

max :: Hex a -> Hex a -> Hex a #

min :: Hex a -> Hex a -> Hex a #

newtype List a Source #

Newtype wrapper to parse and produce a comma separated list of values.

Constructors

List 

Fields

Instances

Instances details
Applicative List Source # 
Instance details

Defined in Data.ByteString.Conversion.Internal

Methods

pure :: a -> List a #

(<*>) :: List (a -> b) -> List a -> List b #

liftA2 :: (a -> b -> c) -> List a -> List b -> List c #

(*>) :: List a -> List b -> List b #

(<*) :: List a -> List b -> List a #

Functor List Source # 
Instance details

Defined in Data.ByteString.Conversion.Internal

Methods

fmap :: (a -> b) -> List a -> List b #

(<$) :: a -> List b -> List a #

Monad List Source # 
Instance details

Defined in Data.ByteString.Conversion.Internal

Methods

(>>=) :: List a -> (a -> List b) -> List b #

(>>) :: List a -> List b -> List b #

return :: a -> List a #

Show a => Show (List a) Source # 
Instance details

Defined in Data.ByteString.Conversion.Internal

Methods

showsPrec :: Int -> List a -> ShowS #

show :: List a -> String #

showList :: [List a] -> ShowS #

FromByteString a => FromByteString (List a) Source #

A (flat) comma-separated list of values without spaces.

Instance details

Defined in Data.ByteString.Conversion.From

Methods

parser :: Parser (List a) Source #

ToByteString a => ToByteString (List a) Source # 
Instance details

Defined in Data.ByteString.Conversion.To

Methods

builder :: List a -> Builder Source #

Eq a => Eq (List a) Source # 
Instance details

Defined in Data.ByteString.Conversion.Internal

Methods

(==) :: List a -> List a -> Bool #

(/=) :: List a -> List a -> Bool #

toByteString' :: ToByteString a => a -> ByteString Source #

Please note that this needs to convert from a lazy ByteString to a strict one which involves copying the whole string.