Files
postgrest/docs/Strings.md
T
2016-12-10 13:28:32 +00:00

948 B

Strings

import qualified Data.Text as T
import qualified Data.Text.Lazy as L

Text

The Text type represents Unicode character strings, in a time and space-efficient manner. This package provides text processing capabilities that are optimized for performance critical use, both in terms of large data quantities and high speed.

LText

Bytestring

LBytestring

Encoding

  • encodeUtf8
  • decodeUtf8
  • decodeUtf8'
  • decodeUtf8With

Conversion

class StringConv a b where
  strConv :: Leniency -> a -> b

data Leniency = Lenient | Strict
toS :: StringConv a b => a -> b
toSL :: StringConv a b => a -> b

Example:

a :: LByteString
a = "Einstein"

b :: Text
b = "Feynmann"

c :: ByteString
c = "Schrödinger"

example1 :: ByteString
example1 = toS b

example2 :: Bool
example2 = (a == toS b) && (toS b == c)