interp-1.0.0.0: Tracery-like randomized text interpolation
Data.Text.Interp.Types
data Binding Source #
A binding of a Key to a path of Keys
Key
Constructors
Fields
Defined in Data.Text.Interp.Types
Methods
(==) :: Binding -> Binding -> Bool #
(/=) :: Binding -> Binding -> Bool #
showsPrec :: Int -> Binding -> ShowS #
show :: Binding -> String #
showList :: [Binding] -> ShowS #
type BindingMap = Map Key Subst Source #
type I = ExceptT Text IO Source #
data IText Source #
A segment of text to interpolate (or not)
Raw text that doesn't need interpolation | Text that requires interpolation
Raw
Optional binding
Path of Keys to the value to interpolate
(==) :: IText -> IText -> Bool #
(/=) :: IText -> IText -> Bool #
showsPrec :: Int -> IText -> ShowS #
show :: IText -> String #
showList :: [IText] -> ShowS #
newtype Key Source #
(==) :: Key -> Key -> Bool #
(/=) :: Key -> Key -> Bool #
compare :: Key -> Key -> Ordering #
(<) :: Key -> Key -> Bool #
(<=) :: Key -> Key -> Bool #
(>) :: Key -> Key -> Bool #
(>=) :: Key -> Key -> Bool #
max :: Key -> Key -> Key #
min :: Key -> Key -> Key #
showsPrec :: Int -> Key -> ShowS #
show :: Key -> String #
showList :: [Key] -> ShowS #
fromString :: String -> Key #
(<>) :: Key -> Key -> Key #
sconcat :: NonEmpty Key -> Key #
stimes :: Integral b => b -> Key -> Key #
mempty :: Key #
mappend :: Key -> Key -> Key #
mconcat :: [Key] -> Key #
data Subst Source #
The main substitution type, either a list, mapping, or single value
a list of values, one of which will be randomly selected
a mapping of Keys to values
a single value
(==) :: Subst -> Subst -> Bool #
(/=) :: Subst -> Subst -> Bool #
showsPrec :: Int -> Subst -> ShowS #
show :: Subst -> String #
showList :: [Subst] -> ShowS #
parseJSON :: Value -> Parser Subst #
parseJSONList :: Value -> Parser [Subst] #
substm :: [(Key, Subst)] -> Subst Source #
Helper function to build a Subst mapping
Subst