glirc-2.14: Console IRC client

Client.Commands.Interpolation

Description

This module is able to parse commands with inline variables and then to evaluate those variables to produce a complete command that varies by the current context.

Synopsis

Documentation

Parsed chunk of an expandable command

Constructors

 LiteralChunk Text regular text VariableChunk Text inline variable $x or ${x y} IntegerChunk Integer inline variable $1 or ${1} DefaultChunk ExpansionChunk Text bracketed variable with default ${x|lit} Instances  Source # MethodsshowList :: [ExpansionChunk] -> ShowS # Parse a Text searching for the expansions as specified in ExpansionChunk. $$ is used to escape a single $.

Arguments

 :: (Text -> Maybe Text) variable resolution -> (Integer -> Maybe Text) argument index resolution -> [ExpansionChunk] chunks -> Maybe Text concatenated, expanded chunks

Attempt to expand all of the elements in the given list using the two expansion functions. If the expansion of any chunk fails the whole expansion fails.