text-plus-0.1.0.1: Utils for text

Safe HaskellNone
LanguageHaskell2010

Data.Text.Plus

Contents

Synopsis

Documentation

module Data.Text

showText :: Show a => a -> Text Source #

readText :: Read a => Text -> a Source #

groupOn :: Eq a => (Char -> a) -> Text -> [(a, Text)] Source #

withoutTags :: Text -> Text Source #

Removes HTML Tags

showTable :: Traversable t => [(Text, a -> Text)] -> t a -> Text Source #

showTableRaw :: (Traversable t1, Traversable t2) => [Text] -> t1 (t2 Text) -> Text Source #

sep :: Text -> Char -> Text -> Text Source #

unsep' :: Monad m => Char -> Text -> m (Text, Text) Source #

tokenize :: Text -> [Text] Source #

Simple tokenizer - that doesn't destroy delimiters, e.g.

>>> tokenize (T.pack "This is blind-text, with punctuation.")
["This"," ","is"," ","blind","-","text",", ","with"," ","punctuation","."]
T.concat (tokenize x) == x

Note: URLs, numbers won't be handled very well.

commonPrefixTotal :: Text -> Text -> (Text, Text, Text) Source #

commonPrefixTotal s t returns a trippel (r,st,tt) s.t. s = r append st, t = r append tt such that r is longest possible.

Note: Contrary to Data.commonPrefix there is no special case when T.null r.

Orphan instances