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 Source #

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

Minimal complete definition

Nothing

Methods

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

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 Source #

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 Source #

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

Instances
Show Bool Source # 
Instance details

Defined in Text.Show.ByteString

Show Char Source # 
Instance details

Defined in Text.Show.ByteString

Show Double Source # 
Instance details

Defined in Text.Show.ByteString

Show Float Source # 
Instance details

Defined in Text.Show.ByteString

Show Int Source # 
Instance details

Defined in Text.Show.ByteString

Show Int8 Source # 
Instance details

Defined in Text.Show.ByteString

Show Int16 Source # 
Instance details

Defined in Text.Show.ByteString

Show Int32 Source # 
Instance details

Defined in Text.Show.ByteString

Show Int64 Source # 
Instance details

Defined in Text.Show.ByteString

Show Integer Source # 
Instance details

Defined in Text.Show.ByteString

Show Ordering Source # 
Instance details

Defined in Text.Show.ByteString

Show Word Source # 
Instance details

Defined in Text.Show.ByteString

Show Word8 Source # 
Instance details

Defined in Text.Show.ByteString

Show Word16 Source # 
Instance details

Defined in Text.Show.ByteString

Show Word32 Source # 
Instance details

Defined in Text.Show.ByteString

Show Word64 Source # 
Instance details

Defined in Text.Show.ByteString

Show () Source # 
Instance details

Defined in Text.Show.ByteString

Methods

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

showp :: () -> Put Source #

showpList :: [()] -> Put Source #

Show Put Source # 
Instance details

Defined in Text.Show.ByteString

Show a => Show [a] Source # 
Instance details

Defined in Text.Show.ByteString

Methods

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

showp :: [a] -> Put Source #

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

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

Defined in Text.Show.ByteString

Methods

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

showp :: Maybe a -> Put Source #

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

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

Defined in Text.Show.ByteString

Methods

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

showp :: Ratio a -> Put Source #

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

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

Defined in Text.Show.ByteString

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

Defined in Text.Show.ByteString

Methods

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

showp :: Set e -> Put Source #

showpList :: [Set e] -> Put Source #

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

Defined in Text.Show.ByteString

Methods

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

showp :: Either a b -> Put Source #

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

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

Defined in Text.Show.ByteString

Methods

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

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

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

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

Defined in Text.Show.ByteString

Methods

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

showp :: Array i e -> Put Source #

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

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

Defined in Text.Show.ByteString

Methods

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

showp :: Map k v -> Put Source #

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

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

Defined in Text.Show.ByteString

Methods

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

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

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

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

Defined in Text.Show.ByteString

Methods

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

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

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

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

Defined in Text.Show.ByteString

Methods

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

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

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

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

Defined in Text.Show.ByteString

Methods

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

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

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

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

Defined in Text.Show.ByteString

Methods

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

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

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

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

Encode a single value into a byte string

Putting Chars

putAscii :: Char -> Put Source #

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

putUTF8 :: Char -> Put Source #

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

Putting Strings

putAsciiStr :: String -> Put Source #

Writes a string of ascii characters to a byte string

putUTF8Str :: String -> Put Source #

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

Putting digits

unsafePutDigit :: Int -> Put Source #

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

putDigit :: Int -> Put Source #

Puts the digit corresponding to the Int passed in.

Putting integers

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

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 Source #

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 Source #

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

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

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

Combining builders

unlinesP :: [Put] -> Put Source #

Merge several string builders, separating them by newlines

unwordsP :: [Put] -> Put Source #

Merge several string builders, separating them by spaces

showpParen :: Bool -> Put -> Put Source #

A utility function for surrounding output by parentheses conditionally.

Printing values

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

Print a value to the standard output

Put

type Put = PutM () Source #

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

newtype PutM a Source #

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 Source #

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

return :: a -> PutM a Source #

fail :: String -> PutM a Source #

Functor PutM 
Instance details

Defined in Data.Binary.Put

Methods

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

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

Applicative PutM 
Instance details

Defined in Data.Binary.Put

Methods

pure :: a -> PutM a Source #

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

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

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

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

Show Put Source # 
Instance details

Defined in Text.Show.ByteString

Semigroup (PutM ()) 
Instance details

Defined in Data.Binary.Put

Methods

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

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

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

Monoid (PutM ()) 
Instance details

Defined in Data.Binary.Put

Methods

mempty :: PutM () Source #

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

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

runPut :: Put -> ByteString Source #

Run the PutM monad with a serialiser