/QuasiText

Interpolated Text strings in Haskell.

Primary LanguageHaskellBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

Interpolated string QuasiQuoter for Text values.

For example:

{-# LANGUAGE OverloadedStrings, QuasiQuotes #-}
import qualified Data.Text.IO as T
import Text.QuasiText

main :: IO ()
main = do
    user  <- T.getLine
    email <- T.getLine
    airSpeedVelocityOfAnUnladenSwallow <- fmap read getLine :: IO Int
    T.putStrLn [embed|
The air speed velocity of an unladen swallow is $airSpeedVelocityOfAnUnladenSwallow.
Your username is $user.
Your email is $email.
1 + 1 = $(1 + 1). |]