interpol-0.2.3: GHC preprocessor and library to enable variable interpolation in strings

Safe HaskellSafe



Support module for the interpol preprocessor.



(^-^), interpol :: (ToString a, ToString b) => a -> b -> StringSource

Append a showable value to a String in a smart way. In particular, do not show a String, as this encloses it in "quotes". So, depending on the type of the second parameter, ^-^ is equivalent to one of the following

   x ^-^ y = x ++ y
   x ^-^ y = x ++ show y

For all intents and purposes, the ToString type-class is a wrapper around Show, so any type that has an instance for Show will also have an instance for Interpol.

class ToString a Source