Copyright | (c) 2008 Dan Doel |
---|---|
Maintainer | Dan Doel |
Stability | Experimental |
Portability | Non-portable (type synonym instances) |
Safe Haskell | None |
Language | Haskell98 |
Text.Show.ByteString
Contents
Description
Efficiently convert from values to lazy byte strings.
Synopsis
- class Show a where
- show :: Show a => a -> ByteString
- putAscii :: Char -> Put
- putUTF8 :: Char -> Put
- putAsciiStr :: String -> Put
- putUTF8Str :: String -> Put
- unsafePutDigit :: Int -> Put
- putDigit :: Int -> Put
- showpIntAtBase :: Integral a => a -> (Int -> Char) -> a -> Put
- showpGFloat :: RealFloat a => Maybe Int -> a -> Put
- showpFFloat :: RealFloat a => Maybe Int -> a -> Put
- showpEFloat :: RealFloat a => Maybe Int -> a -> Put
- unlinesP :: [Put] -> Put
- unwordsP :: [Put] -> Put
- showpParen :: Bool -> Put -> Put
- print :: Show a => a -> IO ()
- type Put = PutM ()
- newtype PutM a = Put {
- unPut :: PairS a
- runPut :: Put -> ByteString
The Show class
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.
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 # | |
Show Char Source # | |
Show Double Source # | |
Show Float Source # | |
Show Int Source # | |
Show Int8 Source # | |
Show Int16 Source # | |
Show Int32 Source # | |
Show Int64 Source # | |
Show Integer Source # | |
Show Ordering Source # | |
Show Word Source # | |
Show Word8 Source # | |
Show Word16 Source # | |
Show Word32 Source # | |
Show Word64 Source # | |
Show () Source # | |
Show Put Source # | |
Show a => Show [a] Source # | |
Show a => Show (Maybe a) Source # | |
(Show a, Integral a) => Show (Ratio a) Source # | |
(Show a, RealFloat a) => Show (Complex a) Source # | |
Show e => Show (Set e) Source # | |
(Show a, Show b) => Show (Either a b) Source # | |
(Show a, Show b) => Show (a, b) Source # | |
(Show i, Show e, Ix i) => Show (Array i e) Source # | |
(Show k, Show v) => Show (Map k v) Source # | |
(Show a, Show b, Show c) => Show (a, b, c) Source # | |
(Show a, Show b, Show c, Show d) => Show (a, b, c, d) Source # | |
(Show a, Show b, Show c, Show d, Show e) => Show (a, b, c, d, e) Source # | |
(Show a, Show b, Show c, Show d, Show e, Show f) => Show (a, b, c, d, e, f) Source # | |
(Show a, Show b, Show c, Show d, Show e, Show f, Show g) => Show (a, b, c, d, e, f, g) Source # | |
Putting Chars
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]
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
showpParen :: Bool -> Put -> Put Source #
A utility function for surrounding output by parentheses conditionally.