bytestring-show-0.3.5.6: Efficient conversion of values into readable byte strings.

Copyright(c) 2008 Dan Doel
MaintainerDan Doel
StabilityExperimental
PortabilityNon-portable (type synonym instances)
Safe HaskellNone
LanguageHaskell98

Text.Show.ByteString

Contents

Description

Efficiently convert from values to lazy byte strings.

Synopsis

The Show class

class Show a where #

Conversion of values to readable byte strings. Minimal complete definition: showp or showpPrec

Minimal complete definition

Nothing

Methods

showpPrec :: Int -> a -> Put #

Encodes a value to an efficient byte string builder. The precedence is used to determine where to put parentheses in a shown expression involving operators.

Values of type Put can be efficiently combined, so the showp functions are available for showing multiple values before producing an output byte string.

showp :: a -> Put #

Encodes a value to an efficient byte string builder. Values of type Put can be efficiently combined, so this is available for building strings from multiple values.

showpList :: [a] -> Put #

Allows for specialized display of lists of values. This is used, for example, when showing arrays of Chars.

Instances
Show Bool # 
Instance details

Defined in Text.Show.ByteString

Methods

showpPrec :: Int -> Bool -> Put #

showp :: Bool -> Put #

showpList :: [Bool] -> Put #

Show Char # 
Instance details

Defined in Text.Show.ByteString

Methods

showpPrec :: Int -> Char -> Put #

showp :: Char -> Put #

showpList :: [Char] -> Put #

Show Double # 
Instance details

Defined in Text.Show.ByteString

Methods

showpPrec :: Int -> Double -> Put #

showp :: Double -> Put #

showpList :: [Double] -> Put #

Show Float # 
Instance details

Defined in Text.Show.ByteString

Methods

showpPrec :: Int -> Float -> Put #

showp :: Float -> Put #

showpList :: [Float] -> Put #

Show Int # 
Instance details

Defined in Text.Show.ByteString

Methods

showpPrec :: Int -> Int -> Put #

showp :: Int -> Put #

showpList :: [Int] -> Put #

Show Int8 # 
Instance details

Defined in Text.Show.ByteString

Methods

showpPrec :: Int -> Int8 -> Put #

showp :: Int8 -> Put #

showpList :: [Int8] -> Put #

Show Int16 # 
Instance details

Defined in Text.Show.ByteString

Methods

showpPrec :: Int -> Int16 -> Put #

showp :: Int16 -> Put #

showpList :: [Int16] -> Put #

Show Int32 # 
Instance details

Defined in Text.Show.ByteString

Methods

showpPrec :: Int -> Int32 -> Put #

showp :: Int32 -> Put #

showpList :: [Int32] -> Put #

Show Int64 # 
Instance details

Defined in Text.Show.ByteString

Methods

showpPrec :: Int -> Int64 -> Put #

showp :: Int64 -> Put #

showpList :: [Int64] -> Put #

Show Integer # 
Instance details

Defined in Text.Show.ByteString

Methods

showpPrec :: Int -> Integer -> Put #

showp :: Integer -> Put #

showpList :: [Integer] -> Put #

Show Ordering # 
Instance details

Defined in Text.Show.ByteString

Show Word # 
Instance details

Defined in Text.Show.ByteString

Methods

showpPrec :: Int -> Word -> Put #

showp :: Word -> Put #

showpList :: [Word] -> Put #

Show Word8 # 
Instance details

Defined in Text.Show.ByteString

Methods

showpPrec :: Int -> Word8 -> Put #

showp :: Word8 -> Put #

showpList :: [Word8] -> Put #

Show Word16 # 
Instance details

Defined in Text.Show.ByteString

Methods

showpPrec :: Int -> Word16 -> Put #

showp :: Word16 -> Put #

showpList :: [Word16] -> Put #

Show Word32 # 
Instance details

Defined in Text.Show.ByteString

Methods

showpPrec :: Int -> Word32 -> Put #

showp :: Word32 -> Put #

showpList :: [Word32] -> Put #

Show Word64 # 
Instance details

Defined in Text.Show.ByteString

Methods

showpPrec :: Int -> Word64 -> Put #

showp :: Word64 -> Put #

showpList :: [Word64] -> Put #

Show () # 
Instance details

Defined in Text.Show.ByteString

Methods

showpPrec :: Int -> () -> Put #

showp :: () -> Put #

showpList :: [()] -> Put #

Show Put # 
Instance details

Defined in Text.Show.ByteString

Methods

showpPrec :: Int -> Put -> Put #

showp :: Put -> Put #

showpList :: [Put] -> Put #

Show a => Show [a] # 
Instance details

Defined in Text.Show.ByteString

Methods

showpPrec :: Int -> [a] -> Put #

showp :: [a] -> Put #

showpList :: [[a]] -> Put #

Show a => Show (Maybe a) # 
Instance details

Defined in Text.Show.ByteString

Methods

showpPrec :: Int -> Maybe a -> Put #

showp :: Maybe a -> Put #

showpList :: [Maybe a] -> Put #

(Show a, Integral a) => Show (Ratio a) # 
Instance details

Defined in Text.Show.ByteString

Methods

showpPrec :: Int -> Ratio a -> Put #

showp :: Ratio a -> Put #

showpList :: [Ratio a] -> Put #

(Show a, RealFloat a) => Show (Complex a) # 
Instance details

Defined in Text.Show.ByteString

Methods

showpPrec :: Int -> Complex a -> Put #

showp :: Complex a -> Put #

showpList :: [Complex a] -> Put #

Show e => Show (Set e) # 
Instance details

Defined in Text.Show.ByteString

Methods

showpPrec :: Int -> Set e -> Put #

showp :: Set e -> Put #

showpList :: [Set e] -> Put #

(Show a, Show b) => Show (Either a b) # 
Instance details

Defined in Text.Show.ByteString

Methods

showpPrec :: Int -> Either a b -> Put #

showp :: Either a b -> Put #

showpList :: [Either a b] -> Put #

(Show a, Show b) => Show (a, b) # 
Instance details

Defined in Text.Show.ByteString

Methods

showpPrec :: Int -> (a, b) -> Put #

showp :: (a, b) -> Put #

showpList :: [(a, b)] -> Put #

(Show i, Show e, Ix i) => Show (Array i e) # 
Instance details

Defined in Text.Show.ByteString

Methods

showpPrec :: Int -> Array i e -> Put #

showp :: Array i e -> Put #

showpList :: [Array i e] -> Put #

(Show k, Show v) => Show (Map k v) # 
Instance details

Defined in Text.Show.ByteString

Methods

showpPrec :: Int -> Map k v -> Put #

showp :: Map k v -> Put #

showpList :: [Map k v] -> Put #

(Show a, Show b, Show c) => Show (a, b, c) # 
Instance details

Defined in Text.Show.ByteString

Methods

showpPrec :: Int -> (a, b, c) -> Put #

showp :: (a, b, c) -> Put #

showpList :: [(a, b, c)] -> Put #

(Show a, Show b, Show c, Show d) => Show (a, b, c, d) # 
Instance details

Defined in Text.Show.ByteString

Methods

showpPrec :: Int -> (a, b, c, d) -> Put #

showp :: (a, b, c, d) -> Put #

showpList :: [(a, b, c, d)] -> Put #

(Show a, Show b, Show c, Show d, Show e) => Show (a, b, c, d, e) # 
Instance details

Defined in Text.Show.ByteString

Methods

showpPrec :: Int -> (a, b, c, d, e) -> Put #

showp :: (a, b, c, d, e) -> Put #

showpList :: [(a, b, c, d, e)] -> Put #

(Show a, Show b, Show c, Show d, Show e, Show f) => Show (a, b, c, d, e, f) # 
Instance details

Defined in Text.Show.ByteString

Methods

showpPrec :: Int -> (a, b, c, d, e, f) -> Put #

showp :: (a, b, c, d, e, f) -> Put #

showpList :: [(a, b, c, d, e, f)] -> Put #

(Show a, Show b, Show c, Show d, Show e, Show f, Show g) => Show (a, b, c, d, e, f, g) # 
Instance details

Defined in Text.Show.ByteString

Methods

showpPrec :: Int -> (a, b, c, d, e, f, g) -> Put #

showp :: (a, b, c, d, e, f, g) -> Put #

showpList :: [(a, b, c, d, e, f, g)] -> Put #

show :: Show a => a -> ByteString #

Encode a single value into a byte string

Putting Chars

putAscii :: Char -> Put #

Writes a single Char to a byte string, assuming it's ascii.

putUTF8 :: Char -> Put #

Writes a single Char to a byte string, properly UTF-8 encoded

Putting Strings

putAsciiStr :: String -> Put #

Writes a string of ascii characters to a byte string

putUTF8Str :: String -> Put #

Writes a string of unicode characters to a byte string, properly UTF-8 encoded

Putting digits

unsafePutDigit :: Int -> Put #

Puts the decimal digit corresponding to the given Int without checking that it is in the interval [0,9]

putDigit :: Int -> Put #

Puts the digit corresponding to the Int passed in.

Putting integers

showpIntAtBase :: Integral a => a -> (Int -> Char) -> a -> Put #

Shows an Integral number using the base specified by the first argument and the chracter representation specified by the second.

Putting floats

showpGFloat :: RealFloat a => Maybe Int -> a -> Put #

Show a signed RealFloat value using decimal notation when the absolute value lies between 0.1 and 9,999,999, and scientific notation otherwise. The optional integer can be used to specify precision.

showpFFloat :: RealFloat a => Maybe Int -> a -> Put #

Show a signed RealFloat value using decimal notation. The optional integer can be used to specify precision.

showpEFloat :: RealFloat a => Maybe Int -> a -> Put #

Show a signed RealFloat value using scientific (exponential) notation. The optional integer can be used to specify precision.

Combining builders

unlinesP :: [Put] -> Put #

Merge several string builders, separating them by newlines

unwordsP :: [Put] -> Put #

Merge several string builders, separating them by spaces

showpParen :: Bool -> Put -> Put #

A utility function for surrounding output by parentheses conditionally.

Printing values

print :: Show a => a -> IO () #

Print a value to the standard output

Put

type Put = PutM () #

Put merely lifts Builder into a Writer monad, applied to ().

newtype PutM a #

The PutM type. A Writer monad over the efficient Builder monoid.

Constructors

Put 

Fields

Instances
Monad PutM 
Instance details

Defined in Data.Binary.Put

Methods

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

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

return :: a -> PutM a #

fail :: String -> PutM a #

Functor PutM 
Instance details

Defined in Data.Binary.Put

Methods

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

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

Applicative PutM 
Instance details

Defined in Data.Binary.Put

Methods

pure :: a -> PutM a #

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

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

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

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

Show Put # 
Instance details

Defined in Text.Show.ByteString

Methods

showpPrec :: Int -> Put -> Put #

showp :: Put -> Put #

showpList :: [Put] -> Put #

Semigroup (PutM ()) 
Instance details

Defined in Data.Binary.Put

Methods

(<>) :: PutM () -> PutM () -> PutM () #

sconcat :: NonEmpty (PutM ()) -> PutM () #

stimes :: Integral b => b -> PutM () -> PutM () #

Monoid (PutM ()) 
Instance details

Defined in Data.Binary.Put

Methods

mempty :: PutM () #

mappend :: PutM () -> PutM () -> PutM () #

mconcat :: [PutM ()] -> PutM () #

runPut :: Put -> ByteString #

Run the PutM monad with a serialiser