Karya, built on 2022-03-21T01:30:44 (patch 89d1651424c35e564138d93424a157ff87457245)
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.

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.