Karya, built on 2020-11-26T21:03:17 (patch 23b5be2d53a9e8e7d6136cda5aae2849abe5cded)
Safe HaskellNone

Util.Texts

Synopsis

conversion

class Textlike a where Source #

Minimal complete definition

toText, fromText

Instances

Instances details
Textlike String.String # 
Instance details

Defined in Util.Texts

Textlike ByteString.Lazy.ByteString # 
Instance details

Defined in Util.Texts

Textlike ByteString.ByteString # 
Instance details

Defined in Util.Texts

Textlike Text # 
Instance details

Defined in Util.Texts

Textlike Html # 
Instance details

Defined in Util.Doc

Textlike Doc # 
Instance details

Defined in Util.Doc

operations

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

Replace substrings simultaneously.

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

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

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

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

The 2 variants join two texts, but omit the separator if one is null.

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

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

columns :: 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.