Karya, built on Mon Jul 24 11:39:07 PDT 2017 (patch 33511aca01257b76b88de7c7a2763b7a965c084e)

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 #

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

Replace substrings simultaneously.

join2 :: (Textlike a, Textlike b) => a -> a -> b Source #

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

joinWith :: (Textlike a, Textlike b) => a -> a -> a -> b Source #

join :: (Textlike a, Textlike b) => a -> [a] -> b 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.