Karya, built on 2023-08-29T07:47:28 (patch 7a412d5d6ba4968ca4155ef276a062ccdeb9109a)
Safe HaskellSafe-Inferred

Util.Texts

Synopsis

conversion

class Textlike a where Source #

Minimal complete definition

toText, fromText

Instances

Instances details
Textlike ByteString.ByteString Source # 
Instance details

Defined in Util.Texts

Textlike ByteString.Lazy.ByteString Source # 
Instance details

Defined in Util.Texts

Textlike Doc Source # 
Instance details

Defined in Util.Doc

Textlike Html Source # 
Instance details

Defined in Util.Html

Textlike Text Source # 
Instance details

Defined in Util.Texts

Textlike String.String Source # 
Instance details

Defined in Util.Texts

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.

columnsSome :: Int -> [Either.Either Text [Text]] -> [Text] Source #

Like columns, but some rows can opt out of formatting by being Left.

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