rio-0.1.24.0: A standard library for Haskell
Safe HaskellSafe-Inferred
LanguageHaskell2010

RIO.Text

Description

Strict Text. Import as:

import qualified RIO.Text as T

This module does not export any partial functions. For those, see RIO.Text.Partial

Synopsis

Types

data Text #

Instances

Instances details
PrintfArg Text 
Instance details

Defined in Data.Text

Methods

formatArg :: Text -> FieldFormatter

parseFormat :: Text -> ModifierParser

Binary Text 
Instance details

Defined in Data.Text

Methods

put :: Text -> Put

get :: Get Text

putList :: [Text] -> Put

NFData Text 
Instance details

Defined in Data.Text

Methods

rnf :: Text -> () #

Monoid Text 
Instance details

Defined in Data.Text

Methods

mempty :: Text #

mappend :: Text -> Text -> Text #

mconcat :: [Text] -> Text #

Semigroup Text 
Instance details

Defined in Data.Text

Methods

(<>) :: Text -> Text -> Text #

sconcat :: NonEmpty Text -> Text

stimes :: Integral b => b -> Text -> Text

Data Text 
Instance details

Defined in Data.Text

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Text -> c Text #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Text #

toConstr :: Text -> Constr #

dataTypeOf :: Text -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Text) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Text) #

gmapT :: (forall b. Data b => b -> b) -> Text -> Text #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Text -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Text -> r #

gmapQ :: (forall d. Data d => d -> u) -> Text -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Text -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Text -> m Text #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Text -> m Text #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Text -> m Text #

IsString Text 
Instance details

Defined in Data.Text

Methods

fromString :: String -> Text #

IsList Text 
Instance details

Defined in Data.Text

Associated Types

type Item Text 
Instance details

Defined in Data.Text

type Item Text = Char

Methods

fromList :: [Item Text] -> Text

fromListN :: Int -> [Item Text] -> Text

toList :: Text -> [Item Text]

Read Text 
Instance details

Defined in Data.Text

Methods

readsPrec :: Int -> ReadS Text

readList :: ReadS [Text]

readPrec :: ReadPrec Text

readListPrec :: ReadPrec [Text]

Show Text 
Instance details

Defined in Data.Text.Show

Methods

showsPrec :: Int -> Text -> ShowS

show :: Text -> String #

showList :: [Text] -> ShowS

Eq Text 
Instance details

Defined in Data.Text

Methods

(==) :: Text -> Text -> Bool #

(/=) :: Text -> Text -> Bool #

Ord Text 
Instance details

Defined in Data.Text

Methods

compare :: Text -> Text -> Ordering #

(<) :: Text -> Text -> Bool #

(<=) :: Text -> Text -> Bool #

(>) :: Text -> Text -> Bool #

(>=) :: Text -> Text -> Bool #

max :: Text -> Text -> Text #

min :: Text -> Text -> Text #

Hashable Text 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSalt :: Int -> Text -> Int

hash :: Text -> Int

Display Text Source #

Since: 0.1.0.0

Instance details

Defined in RIO.Prelude.Display

Lift Text 
Instance details

Defined in Data.Text

Methods

lift :: Quote m => Text -> m Exp

liftTyped :: forall (m :: Type -> Type). Quote m => Text -> Code m Text

type Item Text 
Instance details

Defined in Data.Text

type Item Text = Char

Creation and elimination

Basic interface

cons :: Char -> Text -> Text #

snoc :: Text -> Char -> Text #

append :: Text -> Text -> Text #

null :: Text -> Bool #

Transformations

map :: (Char -> Char) -> Text -> Text #

transpose :: [Text] -> [Text] #

Case conversion

Justification

center :: Int -> Char -> Text -> Text #

Folds

foldl :: (a -> Char -> a) -> a -> Text -> a #

foldl' :: (a -> Char -> a) -> a -> Text -> a #

foldr :: (Char -> a -> a) -> a -> Text -> a #

Special folds

concat :: [Text] -> Text #

concatMap :: (Char -> Text) -> Text -> Text #

any :: (Char -> Bool) -> Text -> Bool #

all :: (Char -> Bool) -> Text -> Bool #

Construction

Scans

scanl :: (Char -> Char -> Char) -> Char -> Text -> Text #

scanl1 :: (Char -> Char -> Char) -> Text -> Text #

scanr :: (Char -> Char -> Char) -> Char -> Text -> Text #

scanr1 :: (Char -> Char -> Char) -> Text -> Text #

Accumulating maps

mapAccumL :: (a -> Char -> (a, Char)) -> a -> Text -> (a, Text) #

mapAccumR :: (a -> Char -> (a, Char)) -> a -> Text -> (a, Text) #

Generation and unfolding

unfoldr :: (a -> Maybe (Char, a)) -> a -> Text #

unfoldrN :: Int -> (a -> Maybe (Char, a)) -> a -> Text #

Substrings

Breaking strings

take :: Int -> Text -> Text #

takeEnd :: Int -> Text -> Text #

drop :: Int -> Text -> Text #

dropEnd :: Int -> Text -> Text #

takeWhile :: (Char -> Bool) -> Text -> Text #

dropWhile :: (Char -> Bool) -> Text -> Text #

dropAround :: (Char -> Bool) -> Text -> Text #

splitAt :: Int -> Text -> (Text, Text) #

break :: (Char -> Bool) -> Text -> (Text, Text) #

span :: (Char -> Bool) -> Text -> (Text, Text) #

group :: Text -> [Text] #

groupBy :: (Char -> Char -> Bool) -> Text -> [Text] #

inits :: Text -> [Text] #

tails :: Text -> [Text] #

Breaking into many substrings

split :: (Char -> Bool) -> Text -> [Text] #

chunksOf :: Int -> Text -> [Text] #

Breaking into lines and words

lines :: Text -> [Text] #

linesCR :: Text -> [Text] Source #

linesCR breaks a Text up into a list of Texts at newline Chars. It is very similar to lines, but it also removes any trailing 'r' characters. The resulting Text values do not contain newlines or trailing 'r' characters.

Since: 0.1.0.0

words :: Text -> [Text] #

unlines :: [Text] -> Text #

unwords :: [Text] -> Text #

Predicates

View patterns

dropPrefix Source #

Arguments

:: Text

prefix

-> Text 
-> Text 

Drop prefix if present, otherwise return original Text.

Since: 0.0.0.0

dropSuffix Source #

Arguments

:: Text

suffix

-> Text 
-> Text 

Drop prefix if present, otherwise return original Text.

Since: 0.0.0.0

Searching

filter :: (Char -> Bool) -> Text -> Text #

find :: (Char -> Bool) -> Text -> Maybe Char #

partition :: (Char -> Bool) -> Text -> (Text, Text) #

Indexing

findIndex :: (Char -> Bool) -> Text -> Maybe Int #

Zipping

zip :: Text -> Text -> [(Char, Char)] #

zipWith :: (Char -> Char -> Char) -> Text -> Text -> Text #

Low level operations

copy :: Text -> Text #

unpackCString# :: Addr# -> Text #

Encoding

decodeUtf8With :: OnDecodeError -> ByteString -> Text #

lenientDecode :: OnDecodeError #