interp-1.0.0.2: Tracery-like randomized text interpolation

Safe HaskellNone
LanguageHaskell2010

Data.Text.Interp.Types

Description

Types shared among other modules

Synopsis

Documentation

data Binding Source #

A binding of a Key to a path of Keys

Constructors

Binding 

Fields

Instances
Eq Binding Source # 
Instance details

Defined in Data.Text.Interp.Types

Methods

(==) :: Binding -> Binding -> Bool #

(/=) :: Binding -> Binding -> Bool #

Show Binding Source # 
Instance details

Defined in Data.Text.Interp.Types

data IText Source #

A segment of text to interpolate (or not)

Constructors

RawText Text

Raw text that doesn't need interpolation | Text that requires interpolation

ToInterpolate 

Fields

Instances
Eq IText Source # 
Instance details

Defined in Data.Text.Interp.Types

Methods

(==) :: IText -> IText -> Bool #

(/=) :: IText -> IText -> Bool #

Show IText Source # 
Instance details

Defined in Data.Text.Interp.Types

Methods

showsPrec :: Int -> IText -> ShowS #

show :: IText -> String #

showList :: [IText] -> ShowS #

newtype Key Source #

Constructors

Key 

Fields

Instances
Eq Key Source # 
Instance details

Defined in Data.Text.Interp.Types

Methods

(==) :: Key -> Key -> Bool #

(/=) :: Key -> Key -> Bool #

Ord Key Source # 
Instance details

Defined in Data.Text.Interp.Types

Methods

compare :: Key -> Key -> Ordering #

(<) :: Key -> Key -> Bool #

(<=) :: Key -> Key -> Bool #

(>) :: Key -> Key -> Bool #

(>=) :: Key -> Key -> Bool #

max :: Key -> Key -> Key #

min :: Key -> Key -> Key #

Show Key Source # 
Instance details

Defined in Data.Text.Interp.Types

Methods

showsPrec :: Int -> Key -> ShowS #

show :: Key -> String #

showList :: [Key] -> ShowS #

IsString Key Source # 
Instance details

Defined in Data.Text.Interp.Types

Methods

fromString :: String -> Key #

Semigroup Key Source # 
Instance details

Defined in Data.Text.Interp.Types

Methods

(<>) :: Key -> Key -> Key #

sconcat :: NonEmpty Key -> Key #

stimes :: Integral b => b -> Key -> Key #

Monoid Key Source # 
Instance details

Defined in Data.Text.Interp.Types

Methods

mempty :: Key #

mappend :: Key -> Key -> Key #

mconcat :: [Key] -> Key #

data Subst Source #

The main substitution type, either a list, mapping, or single value

Constructors

SubstL [Subst]

a list of values, one of which will be randomly selected

SubstM (Map Key Subst)

a mapping of Keys to values

SubstV Text

a single value

Instances
Eq Subst Source # 
Instance details

Defined in Data.Text.Interp.Types

Methods

(==) :: Subst -> Subst -> Bool #

(/=) :: Subst -> Subst -> Bool #

Show Subst Source # 
Instance details

Defined in Data.Text.Interp.Types

Methods

showsPrec :: Int -> Subst -> ShowS #

show :: Subst -> String #

showList :: [Subst] -> ShowS #

FromJSON Subst Source # 
Instance details

Defined in Data.Text.Interp.Types

substm :: [(Key, Subst)] -> Subst Source #

Helper function to build a Subst mapping