text-show
Version 1 revision 2 uploaded by HerbertValerioRiedel.
Package meta
- Synopsis
- Efficient conversion of values into Text
- Description
text-show
offers a replacement for theShow
typeclass intended for use withText
instead ofString
s. This package was created in the spirit ofbytestring-show
.At the moment,
text-show
providesShow
instances for most data types in thearray
,base
,bytestring
, andtext
packages. Therefore, much of the source code fortext-show
consists of borrowed code from those packages in order to ensure that the behaviors of the twoShow
typeclasses coincide.For most uses, simply importing Text.Show.Text will suffice:
module Main where import Data.Text (Text) import Prelude hiding (Show(..), print) import Text.Show.Text hello :: Text hello = show (Just "Hello, World!") main :: IO () main = print hello
If you desire it, there are also monomorphic versions of the
showb
function available in the submodules of Text.Show.Text. A naming convention is present in which functions that show different values depending on the precedence end withPrec
(e.g.,showbIntPrec
), whereas functions that show the same values regardless of precedence do not end withPrec
(e.g.,showbBool
).Support for automatically deriving
Show
instances can be found in the Text.Show.Text.TH and Text.Show.Text.Generic modules. If you don't know which one to use, useText.Show.Text.TH
.- Author
- Ryan Scott
- Bug reports
- https://github.com/RyanGlScott/text-show/issues
- Category
- Text
- Copyright
- (C) 2014-2015 Ryan Scott
- Homepage
- https://github.com/RyanGlScott/text-show
- Maintainer
- Ryan Scott <ryan.gl.scott@gmail.com>
- Package URL
- n/a
- Stability
- Provisional