Copyright | (C) 2014-2017 Ryan Scott |
---|---|
License | BSD-style (see the file LICENSE) |
Maintainer | Ryan Scott |
Stability | Provisional |
Portability | GHC |
Safe Haskell | None |
Language | Haskell2010 |
Efficiently convert from values to Text
via Builder
s.
Since: 2
Synopsis
- class TextShow a where
- showbParen :: Bool -> Builder -> Builder
- showtParen :: Bool -> Text -> Text
- showtlParen :: Bool -> Text -> Text
- showbCommaSpace :: Builder
- showtCommaSpace :: Text
- showtlCommaSpace :: Text
- showbSpace :: Builder
- showtSpace :: Text
- showtlSpace :: Text
- class TextShow1 f where
- showbPrec1 :: (TextShow1 f, TextShow a) => Int -> f a -> Builder
- showbUnaryWith :: (Int -> a -> Builder) -> Builder -> Int -> a -> Builder
- liftShowtPrec :: TextShow1 f => (Int -> a -> Text) -> ([a] -> Text) -> Int -> f a -> Text
- liftShowtlPrec :: TextShow1 f => (Int -> a -> Text) -> ([a] -> Text) -> Int -> f a -> Text
- class TextShow2 f where
- showbPrec2 :: (TextShow2 f, TextShow a, TextShow b) => Int -> f a b -> Builder
- showbBinaryWith :: (Int -> a -> Builder) -> (Int -> b -> Builder) -> Builder -> Int -> a -> b -> Builder
- liftShowtPrec2 :: TextShow2 f => (Int -> a -> Text) -> ([a] -> Text) -> (Int -> b -> Text) -> ([b] -> Text) -> Int -> f a b -> Text
- liftShowtlPrec2 :: TextShow2 f => (Int -> a -> Text) -> ([a] -> Text) -> (Int -> b -> Text) -> ([b] -> Text) -> Int -> f a b -> Text
- data Builder
- toText :: Builder -> Text
- toLazyText :: Builder -> Text
- toLazyTextWith :: Int -> Builder -> Text
- toString :: Builder -> String
- singleton :: Char -> Builder
- fromText :: Text -> Builder
- fromLazyText :: Text -> Builder
- fromString :: String -> Builder
- flush :: Builder
- lengthB :: Builder -> Int64
- unlinesB :: [Builder] -> Builder
- unwordsB :: [Builder] -> Builder
- printT :: TextShow a => a -> IO ()
- printTL :: TextShow a => a -> IO ()
- hPrintT :: TextShow a => Handle -> a -> IO ()
- hPrintTL :: TextShow a => Handle -> a -> IO ()
- newtype FromStringShow a = FromStringShow {
- fromStringShow :: a
- newtype FromTextShow a = FromTextShow {
- fromTextShow :: a
- newtype FromStringShow1 f a = FromStringShow1 {
- fromStringShow1 :: f a
- newtype FromTextShow1 f a = FromTextShow1 {
- fromTextShow1 :: f a
- newtype FromStringShow2 f a b = FromStringShow2 {
- fromStringShow2 :: f a b
- newtype FromTextShow2 f a b = FromTextShow2 {
- fromTextShow2 :: f a b
- showsPrecToShowbPrec :: (Int -> a -> ShowS) -> Int -> a -> Builder
- showsToShowb :: (a -> ShowS) -> a -> Builder
- showbPrecToShowsPrec :: (Int -> a -> Builder) -> Int -> a -> ShowS
- showbToShows :: (a -> Builder) -> a -> ShowS
- showtPrecToShowbPrec :: (Int -> a -> Text) -> Int -> a -> Builder
- showtlPrecToShowbPrec :: (Int -> a -> Text) -> Int -> a -> Builder
- showtToShowb :: (a -> Text) -> a -> Builder
- showtlToShowb :: (a -> Text) -> a -> Builder
- showbPrecToShowtPrec :: (Int -> a -> Builder) -> Int -> a -> Text
- showbPrecToShowtlPrec :: (Int -> a -> Builder) -> Int -> a -> Text
- showbToShowt :: (a -> Builder) -> a -> Text
- showbToShowtl :: (a -> Builder) -> a -> Text
The TextShow
classes
TextShow
class TextShow a where Source #
Conversion of values to Text
. Because there are both strict and lazy Text
variants, the TextShow
class deliberately avoids using Text
in its functions.
Instead, showbPrec
, showb
, and showbList
all return Builder
, an
efficient intermediate form that can be converted to either kind of Text
.
Builder
is a Monoid
, so it is useful to use the mappend
(or <>
) function
to combine Builder
s when creating TextShow
instances. As an example:
import Data.Semigroup import TextShow data Example = Example Int Int instance TextShow Example where showb (Example i1 i2) = showb i1 <> showbSpace <> showb i2
If you do not want to create TextShow
instances manually, you can alternatively
use the TextShow.TH module to automatically generate default TextShow
instances using Template Haskell, or the TextShow.Generic module to
quickly define TextShow
instances using GHC.Generics.
Since: 2
:: Int | The operator precedence of the enclosing context (a number
from |
-> a | The value to be converted to a |
-> Builder |
Convert a value to a Builder
with the given predence.
Since: 2
Converts a value to a strict Text
. If you hand-define this, it should
satisfy:
showb
=showbPrec
0
Since: 2
Converts a list of values to a Builder
. By default, this is defined as
'showbList =
, but it can be overridden to allow
for specialized displaying of lists (e.g., lists of showbListWith
showb
Char
s).
Since: 2
:: Int | The operator precedence of the enclosing context (a number
from |
-> a | The value to be converted to a strict |
-> Text |
Converts a value to a strict Text
with the given precedence. This
can be overridden for efficiency, but it should satisfy:
showtPrec
p =toStrict
.showtlPrec
p
Since: 3
Converts a value to a strict Text
. This can be overridden for
efficiency, but it should satisfy:
showt
=showtPrec
0showt
=toStrict
.showtl
The first equation is the default definition of showt
.
Since: 3
Converts a list of values to a strict Text
. This can be overridden for
efficiency, but it should satisfy:
showtList
=toStrict
.showtlList
Since: 3
:: Int | The operator precedence of the enclosing context (a number
from |
-> a | The value to be converted to a lazy |
-> Text |
Converts a value to a lazy Text
with the given precedence. This
can be overridden for efficiency, but it should satisfy:
showtlPrec
p =toLazyText
.showbPrec
p
Since: 3
Converts a value to a lazy Text
. This can be overridden for
efficiency, but it should satisfy:
showtl
=showtlPrec
0showtl
=toLazyText
.showb
The first equation is the default definition of showtl
.
Since: 3
Converts a list of values to a lazy Text
. This can be overridden for
efficiency, but it should satisfy:
showtlList
=toLazyText
.showbList
Since: 3
Instances
showbCommaSpace :: Builder Source #
Construct a Builder
containing a comma followed by a space.
Since: 3.6
showtCommaSpace :: Text Source #
Construct a strict Text
containing a comma followed by a space.
Since: 3.6
showtlCommaSpace :: Text Source #
Construct a lazy Text
containing a comma followed by a space.
Since: 3.6
showbSpace :: Builder Source #
Construct a Builder
containing a single space character.
Since: 2
showtSpace :: Text Source #
Construct a strict Text
containing a single space character.
Since: 3.4
showtlSpace :: Text Source #
Construct a lazy Text
containing a single space character.
Since: 3.4
TextShow1
class TextShow1 f where Source #
Lifting of the TextShow
class to unary type constructors.
Since: 2
liftShowbPrec :: (Int -> a -> Builder) -> ([a] -> Builder) -> Int -> f a -> Builder Source #
showbPrec
function for an application of the type constructor
based on showbPrec
and showbList
functions for the argument type.
Since: 3
liftShowbList :: (Int -> a -> Builder) -> ([a] -> Builder) -> [f a] -> Builder Source #
Instances
showbUnaryWith :: (Int -> a -> Builder) -> Builder -> Int -> a -> Builder Source #
produces the showbUnaryWith
sp n p xBuilder
representation of a unary data
constructor with name n
and argument x
, in precedence context p
, using the
function sp
to show occurrences of the type argument.
Since: 2
liftShowtPrec :: TextShow1 f => (Int -> a -> Text) -> ([a] -> Text) -> Int -> f a -> Text Source #
showtPrec
function for an application of the type constructor
based on showtPrec
and showtList
functions for the argument type.
The current implementation is based on liftShowbPrec
internally.
Since: 3.4
liftShowtlPrec :: TextShow1 f => (Int -> a -> Text) -> ([a] -> Text) -> Int -> f a -> Text Source #
showtlPrec
function for an application of the type constructor
based on showtlPrec
and showtlList
functions for the argument type.
The current implementation is based on liftShowbPrec
internally.
Since: 3.4
TextShow2
class TextShow2 f where Source #
Lifting of the TextShow
class to binary type constructors.
Since: 2
liftShowbPrec2 :: (Int -> a -> Builder) -> ([a] -> Builder) -> (Int -> b -> Builder) -> ([b] -> Builder) -> Int -> f a b -> Builder Source #
showbPrec
function for an application of the type constructor
based on showbPrec
and showbList
functions for the argument types.
Since: 3
liftShowbList2 :: (Int -> a -> Builder) -> ([a] -> Builder) -> (Int -> b -> Builder) -> ([b] -> Builder) -> [f a b] -> Builder Source #
Instances
TextShow2 Either Source # | Since: 2 |
Defined in TextShow.Data.Either | |
TextShow2 (,) Source # | Since: 2 |
Defined in TextShow.Data.Tuple | |
TextShow2 ST Source # | Since: 2 |
Defined in TextShow.Control.Monad.ST | |
TextShow2 Arg Source # | Since: 3 |
Defined in TextShow.Data.Semigroup | |
TextShow a => TextShow2 ((,,) a) Source # | Since: 2 |
Defined in TextShow.Data.Tuple | |
TextShow2 (Const :: Type -> Type -> Type) Source # | Since: 2 |
Defined in TextShow.Control.Applicative | |
TextShow2 (Coercion :: Type -> Type -> Type) Source # | Since: 2 |
Defined in TextShow.Data.Type.Coercion | |
TextShow2 ((:~:) :: Type -> Type -> Type) Source # | Since: 2 |
Defined in TextShow.Data.Type.Equality | |
TextShow2 ((->) :: Type -> Type -> Type) Source # | Since: 2 |
Defined in TextShow.Functions | |
TextShow2 (K1 i :: Type -> Type -> Type) Source # | Since: 2 |
Defined in TextShow.GHC.Generics | |
(TextShow a, TextShow b) => TextShow2 ((,,,) a b) Source # | Since: 2 |
Defined in TextShow.Data.Tuple liftShowbPrec2 :: (Int -> a0 -> Builder) -> ([a0] -> Builder) -> (Int -> b0 -> Builder) -> ([b0] -> Builder) -> Int -> (a, b, a0, b0) -> Builder Source # liftShowbList2 :: (Int -> a0 -> Builder) -> ([a0] -> Builder) -> (Int -> b0 -> Builder) -> ([b0] -> Builder) -> [(a, b, a0, b0)] -> Builder Source # | |
TextShow2 ((:~~:) :: Type -> Type -> Type) Source # | Since: 3.6 |
Defined in TextShow.Data.Type.Equality | |
(TextShow a, TextShow b, TextShow c) => TextShow2 ((,,,,) a b c) Source # | Since: 2 |
Defined in TextShow.Data.Tuple liftShowbPrec2 :: (Int -> a0 -> Builder) -> ([a0] -> Builder) -> (Int -> b0 -> Builder) -> ([b0] -> Builder) -> Int -> (a, b, c, a0, b0) -> Builder Source # liftShowbList2 :: (Int -> a0 -> Builder) -> ([a0] -> Builder) -> (Int -> b0 -> Builder) -> ([b0] -> Builder) -> [(a, b, c, a0, b0)] -> Builder Source # | |
TextShow2 f => TextShow2 (FromTextShow2 f) Source # | |
Defined in TextShow.FromStringTextShow liftShowbPrec2 :: (Int -> a -> Builder) -> ([a] -> Builder) -> (Int -> b -> Builder) -> ([b] -> Builder) -> Int -> FromTextShow2 f a b -> Builder Source # liftShowbList2 :: (Int -> a -> Builder) -> ([a] -> Builder) -> (Int -> b -> Builder) -> ([b] -> Builder) -> [FromTextShow2 f a b] -> Builder Source # | |
Show2 f => TextShow2 (FromStringShow2 f) Source # | Not available if using |
Defined in TextShow.FromStringTextShow liftShowbPrec2 :: (Int -> a -> Builder) -> ([a] -> Builder) -> (Int -> b -> Builder) -> ([b] -> Builder) -> Int -> FromStringShow2 f a b -> Builder Source # liftShowbList2 :: (Int -> a -> Builder) -> ([a] -> Builder) -> (Int -> b -> Builder) -> ([b] -> Builder) -> [FromStringShow2 f a b] -> Builder Source # | |
(TextShow a, TextShow b, TextShow c, TextShow d) => TextShow2 ((,,,,,) a b c d) Source # | Since: 2 |
Defined in TextShow.Data.Tuple liftShowbPrec2 :: (Int -> a0 -> Builder) -> ([a0] -> Builder) -> (Int -> b0 -> Builder) -> ([b0] -> Builder) -> Int -> (a, b, c, d, a0, b0) -> Builder Source # liftShowbList2 :: (Int -> a0 -> Builder) -> ([a0] -> Builder) -> (Int -> b0 -> Builder) -> ([b0] -> Builder) -> [(a, b, c, d, a0, b0)] -> Builder Source # | |
(TextShow a, TextShow b, TextShow c, TextShow d, TextShow e) => TextShow2 ((,,,,,,) a b c d e) Source # | Since: 2 |
Defined in TextShow.Data.Tuple liftShowbPrec2 :: (Int -> a0 -> Builder) -> ([a0] -> Builder) -> (Int -> b0 -> Builder) -> ([b0] -> Builder) -> Int -> (a, b, c, d, e, a0, b0) -> Builder Source # liftShowbList2 :: (Int -> a0 -> Builder) -> ([a0] -> Builder) -> (Int -> b0 -> Builder) -> ([b0] -> Builder) -> [(a, b, c, d, e, a0, b0)] -> Builder Source # | |
(TextShow a, TextShow b, TextShow c, TextShow d, TextShow e, TextShow f) => TextShow2 ((,,,,,,,) a b c d e f) Source # | Since: 2 |
Defined in TextShow.Data.Tuple liftShowbPrec2 :: (Int -> a0 -> Builder) -> ([a0] -> Builder) -> (Int -> b0 -> Builder) -> ([b0] -> Builder) -> Int -> (a, b, c, d, e, f, a0, b0) -> Builder Source # liftShowbList2 :: (Int -> a0 -> Builder) -> ([a0] -> Builder) -> (Int -> b0 -> Builder) -> ([b0] -> Builder) -> [(a, b, c, d, e, f, a0, b0)] -> Builder Source # | |
(TextShow a, TextShow b, TextShow c, TextShow d, TextShow e, TextShow f, TextShow g) => TextShow2 ((,,,,,,,,) a b c d e f g) Source # | Since: 2 |
Defined in TextShow.Data.Tuple liftShowbPrec2 :: (Int -> a0 -> Builder) -> ([a0] -> Builder) -> (Int -> b0 -> Builder) -> ([b0] -> Builder) -> Int -> (a, b, c, d, e, f, g, a0, b0) -> Builder Source # liftShowbList2 :: (Int -> a0 -> Builder) -> ([a0] -> Builder) -> (Int -> b0 -> Builder) -> ([b0] -> Builder) -> [(a, b, c, d, e, f, g, a0, b0)] -> Builder Source # | |
(TextShow a, TextShow b, TextShow c, TextShow d, TextShow e, TextShow f, TextShow g, TextShow h) => TextShow2 ((,,,,,,,,,) a b c d e f g h) Source # | Since: 2 |
Defined in TextShow.Data.Tuple liftShowbPrec2 :: (Int -> a0 -> Builder) -> ([a0] -> Builder) -> (Int -> b0 -> Builder) -> ([b0] -> Builder) -> Int -> (a, b, c, d, e, f, g, h, a0, b0) -> Builder Source # liftShowbList2 :: (Int -> a0 -> Builder) -> ([a0] -> Builder) -> (Int -> b0 -> Builder) -> ([b0] -> Builder) -> [(a, b, c, d, e, f, g, h, a0, b0)] -> Builder Source # | |
(TextShow a, TextShow b, TextShow c, TextShow d, TextShow e, TextShow f, TextShow g, TextShow h, TextShow i) => TextShow2 ((,,,,,,,,,,) a b c d e f g h i) Source # | Since: 2 |
Defined in TextShow.Data.Tuple liftShowbPrec2 :: (Int -> a0 -> Builder) -> ([a0] -> Builder) -> (Int -> b0 -> Builder) -> ([b0] -> Builder) -> Int -> (a, b, c, d, e, f, g, h, i, a0, b0) -> Builder Source # liftShowbList2 :: (Int -> a0 -> Builder) -> ([a0] -> Builder) -> (Int -> b0 -> Builder) -> ([b0] -> Builder) -> [(a, b, c, d, e, f, g, h, i, a0, b0)] -> Builder Source # | |
(TextShow a, TextShow b, TextShow c, TextShow d, TextShow e, TextShow f, TextShow g, TextShow h, TextShow i, TextShow j) => TextShow2 ((,,,,,,,,,,,) a b c d e f g h i j) Source # | Since: 2 |
Defined in TextShow.Data.Tuple liftShowbPrec2 :: (Int -> a0 -> Builder) -> ([a0] -> Builder) -> (Int -> b0 -> Builder) -> ([b0] -> Builder) -> Int -> (a, b, c, d, e, f, g, h, i, j, a0, b0) -> Builder Source # liftShowbList2 :: (Int -> a0 -> Builder) -> ([a0] -> Builder) -> (Int -> b0 -> Builder) -> ([b0] -> Builder) -> [(a, b, c, d, e, f, g, h, i, j, a0, b0)] -> Builder Source # | |
(TextShow a, TextShow b, TextShow c, TextShow d, TextShow e, TextShow f, TextShow g, TextShow h, TextShow i, TextShow j, TextShow k) => TextShow2 ((,,,,,,,,,,,,) a b c d e f g h i j k) Source # | Since: 2 |
Defined in TextShow.Data.Tuple liftShowbPrec2 :: (Int -> a0 -> Builder) -> ([a0] -> Builder) -> (Int -> b0 -> Builder) -> ([b0] -> Builder) -> Int -> (a, b, c, d, e, f, g, h, i, j, k, a0, b0) -> Builder Source # liftShowbList2 :: (Int -> a0 -> Builder) -> ([a0] -> Builder) -> (Int -> b0 -> Builder) -> ([b0] -> Builder) -> [(a, b, c, d, e, f, g, h, i, j, k, a0, b0)] -> Builder Source # | |
(TextShow a, TextShow b, TextShow c, TextShow d, TextShow e, TextShow f, TextShow g, TextShow h, TextShow i, TextShow j, TextShow k, TextShow l) => TextShow2 ((,,,,,,,,,,,,,) a b c d e f g h i j k l) Source # | Since: 2 |
Defined in TextShow.Data.Tuple liftShowbPrec2 :: (Int -> a0 -> Builder) -> ([a0] -> Builder) -> (Int -> b0 -> Builder) -> ([b0] -> Builder) -> Int -> (a, b, c, d, e, f, g, h, i, j, k, l, a0, b0) -> Builder Source # liftShowbList2 :: (Int -> a0 -> Builder) -> ([a0] -> Builder) -> (Int -> b0 -> Builder) -> ([b0] -> Builder) -> [(a, b, c, d, e, f, g, h, i, j, k, l, a0, b0)] -> Builder Source # | |
(TextShow a, TextShow b, TextShow c, TextShow d, TextShow e, TextShow f, TextShow g, TextShow h, TextShow i, TextShow j, TextShow k, TextShow l, TextShow m) => TextShow2 ((,,,,,,,,,,,,,,) a b c d e f g h i j k l m) Source # | Since: 2 |
Defined in TextShow.Data.Tuple liftShowbPrec2 :: (Int -> a0 -> Builder) -> ([a0] -> Builder) -> (Int -> b0 -> Builder) -> ([b0] -> Builder) -> Int -> (a, b, c, d, e, f, g, h, i, j, k, l, m, a0, b0) -> Builder Source # liftShowbList2 :: (Int -> a0 -> Builder) -> ([a0] -> Builder) -> (Int -> b0 -> Builder) -> ([b0] -> Builder) -> [(a, b, c, d, e, f, g, h, i, j, k, l, m, a0, b0)] -> Builder Source # |
showbPrec2 :: (TextShow2 f, TextShow a, TextShow b) => Int -> f a b -> Builder Source #
Lift two showbPrec
functions through the type constructor.
Since: 2
showbBinaryWith :: (Int -> a -> Builder) -> (Int -> b -> Builder) -> Builder -> Int -> a -> b -> Builder Source #
produces the showbBinaryWith
sp n p x yBuilder
representation of a binary
data constructor with name n
and arguments x
and y
, in precedence context
p
, using the functions sp1
and sp2
to show occurrences of the type arguments.
Since: 2
liftShowtPrec2 :: TextShow2 f => (Int -> a -> Text) -> ([a] -> Text) -> (Int -> b -> Text) -> ([b] -> Text) -> Int -> f a b -> Text Source #
showtPrec
function for an application of the type constructor
based on showtPrec
and showtList
functions for the argument type.
The current implementation is based on liftShowbPrec2
internally.
Since: 3.4
liftShowtlPrec2 :: TextShow2 f => (Int -> a -> Text) -> ([a] -> Text) -> (Int -> b -> Text) -> ([b] -> Text) -> Int -> f a b -> Text Source #
showtlPrec
function for an application of the type constructor
based on showtlPrec
and showtlList
functions for the argument type.
The current implementation is based on liftShowbPrec2
internally.
Since: 3.4
Builder
s
The Builder
type
A Builder
is an efficient way to build lazy Text
values.
There are several functions for constructing builders, but only one
to inspect them: to extract any data, you have to turn them into
lazy Text
values using toLazyText
.
Internally, a builder constructs a lazy Text
by filling arrays
piece by piece. As each buffer is filled, it is 'popped' off, to
become a new chunk of the resulting lazy Text
. All this is
hidden from the user of the Builder
.
Instances
Eq Builder | |
Ord Builder | |
Show Builder | |
IsString Builder | |
Defined in Data.Text.Internal.Builder fromString :: String -> Builder # | |
Semigroup Builder | |
Monoid Builder | |
TextShow Builder Source # | Since: 2 |
Defined in TextShow.Data.Text showbPrec :: Int -> Builder -> Builder Source # showb :: Builder -> Builder Source # showbList :: [Builder] -> Builder Source # showtPrec :: Int -> Builder -> Text Source # showt :: Builder -> Text Source # showtList :: [Builder] -> Text Source # showtlPrec :: Int -> Builder -> Text Source # showtl :: Builder -> Text Source # showtlList :: [Builder] -> Text Source # |
toLazyText :: Builder -> Text #
O(n). Extract a lazy Text
from a Builder
with a default
buffer size. The construction work takes place if and when the
relevant part of the lazy Text
is demanded.
toLazyTextWith :: Int -> Builder -> Text #
O(n). Extract a lazy Text
from a Builder
, using the given
size for the initial buffer. The construction work takes place if
and when the relevant part of the lazy Text
is demanded.
If the initial buffer is too small to hold all data, subsequent buffers will be the default buffer size.
Constructing Builder
s
singleton :: Char -> Builder #
O(1). A Builder
taking a single character, satisfying
toLazyText
(singleton
c) =singleton
c
O(1). A Builder
taking a Text
, satisfying
toLazyText
(fromText
t) =fromChunks
[t]
fromLazyText :: Text -> Builder #
O(1). A Builder
taking a lazy Text
, satisfying
toLazyText
(fromLazyText
t) = t
fromString :: String -> Builder #
O(1). A Builder taking a String
, satisfying
toLazyText
(fromString
s) =fromChunks
[S.pack s]
Flushing the buffer state
O(1). Pop the strict Text
we have constructed so far, if any,
yielding a new chunk in the result lazy Text
.
Builder
utility functions
unlinesB :: [Builder] -> Builder Source #
Merges several Builder
s, separating them by newlines.
Since: 2
unwordsB :: [Builder] -> Builder Source #
Merges several Builder
s, separating them by spaces.
Since: 2
Printing values
printT :: TextShow a => a -> IO () Source #
Writes a value's strict Text
representation to the standard output, followed
by a newline.
Since: 2
printTL :: TextShow a => a -> IO () Source #
Writes a value's lazy Text
representation to the standard output, followed
by a newline.
Since: 2
hPrintT :: TextShow a => Handle -> a -> IO () Source #
Writes a value's strict Text
representation to a file handle, followed
by a newline.
Since: 2
hPrintTL :: TextShow a => Handle -> a -> IO () Source #
Writes a value's lazy Text
representation to a file handle, followed
by a newline.
Since: 2
Conversions
Conversion between TextShow
and string Show
newtype FromStringShow a Source #
An adapter newtype, suitable for DerivingVia
.
The TextShow
instance for FromStringShow
is based on its String
Show
instance. That is,
showbPrec p (FromStringShow
x) =showsToShowb
showsPrec
p x
Since: 2
Instances
newtype FromTextShow a Source #
An adapter newtype, suitable for DerivingVia
.
The String
Show
instance for FromTextShow
is based on its
TextShow
instance. That is,
showsPrec p (FromTextShow
x) =showbToShows
showbPrec
p x
Since: 2
FromTextShow | |
|
Instances
newtype FromStringShow1 f a Source #
An adapter newtype, suitable for DerivingVia
.
The TextShow1
instance for FromStringShow1
is based on its String
Show1
instance. That is,
liftShowbPrec
sp sl p (FromStringShow1
x) =showsPrecToShowbPrec
(liftShowsPrec
(showbPrecToShowsPrec
sp) (showbToShows
sl)) p x
Since: 3
FromStringShow1 | |
|
Instances
newtype FromTextShow1 f a Source #
An adapter newtype, suitable for DerivingVia
.
The String
Show1
instance for FromTextShow1
is based on its
TextShow1
instance. That is,
liftShowsPrec
sp sl p (FromTextShow1
x) =showbPrecToShowsPrec
(liftShowbPrec
(showsPrecToShowbPrec
sp) (showsToShowb
sl)) p x
Since: 3
FromTextShow1 | |
|
Instances
newtype FromStringShow2 f a b Source #
An adapter newtype, suitable for DerivingVia
.
The TextShow2
instance for FromStringShow2
is based on its String
Show2
instance. That is,
liftShowbPrec2
sp1 sl1 sp2 sl2 p (FromStringShow2
x) =showsPrecToShowbPrec
(liftShowsPrec2
(showbPrecToShowsPrec
sp1) (showbToShows
sl1) (showbPrecToShowsPrec
sp2) (showbToShows
sl2)) p x
Since: 3
FromStringShow2 | |
|
Instances
newtype FromTextShow2 f a b Source #
An adapter newtype, suitable for DerivingVia
.
The String
Show2
instance for FromTextShow2
is based on its
TextShow2
instance. That is,
liftShowsPrec2 sp1 sl1 sp2 sl2 p (FromTextShow2
x) =showbPrecToShowsPrec
(liftShowbPrec2
(showsPrecToShowbPrec
sp1) (showsToShowb
sl1) (showsPrecToShowbPrec
sp2) (showsToShowb
sl2)) p x
Since: 3
FromTextShow2 | |
|
Instances
showsToShowb :: (a -> ShowS) -> a -> Builder Source #
showbToShows :: (a -> Builder) -> a -> ShowS Source #
Conversions between Builder
, strict Text
, and lazy Text
showtToShowb :: (a -> Text) -> a -> Builder Source #
showtlToShowb :: (a -> Text) -> a -> Builder Source #
showbToShowt :: (a -> Builder) -> a -> Text Source #