Karya, built on 2018-05-31T02:46:59 (patch 0a1a35479c514820d77330ae8a978975ba22a47a)

Safe HaskellNone

Util.TextUtil

Contents

Synopsis

Documentation

class Textlike a where Source #

Minimal complete definition

toText, fromText

Methods

toText :: a -> Text Source #

fromText :: Text -> a Source #

Instances
Textlike String.String # 
Instance details

Defined in Util.TextUtil

Textlike Text # 
Instance details

Defined in Util.TextUtil

Textlike Html # 
Instance details

Defined in Util.Doc

Textlike Doc # 
Instance details

Defined in Util.Doc

replaceMany :: [(Text, Text)] -> Text -> Text Source #

Replace substrings simultaneously.

join2 :: Textlike a => a -> a -> a Source #

Join the two pieces with a space, if they are non-empty.

joinWith :: Textlike a => a -> a -> a -> a Source #

join :: Textlike a => a -> [a] -> a Source #

formatColumns :: Int -> [[Text]] -> [Text] Source #

Format the given rows into columns, aligned vertically.

mapDelimited :: Bool -> Char.Char -> (Text -> Text) -> Text -> Text Source #

Apply a function to the contents delimited by the given Char. You can quote a delimiter with a backslash.

mapDelimitedM :: Monad m => Bool -> Char.Char -> (Text -> m Text) -> Text -> m Text Source #

extractDelimited Source #

Arguments

:: Bool

If false, a delimiter doesn't count if the text after it has a space.

-> Char.Char 
-> Text 
-> [(Text, Maybe.Maybe Text)] 

This is more awkward than a parser, but... ok, maybe I should have used a parser.

interpolate

interpolate :: Text -> Map Text Text -> Either Text Text Source #

Replace ${variable}.

haddockUrl

haddockUrl :: Files -> FilePath -> Text -> Maybe.Maybe Url Source #

This doesn't really belong here, but it can't go in Linkify since that's a main module.