-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/

-- | A toolkit for making compile-time interpolated templates
--   
--   Shakespeare is a family of type-safe, efficient template languages.
--   Shakespeare templates are expanded at compile-time, ensuring that all
--   interpolated variables are in scope. Variables are interpolated
--   according to their type through a typeclass.
--   
--   Shakespeare templates can be used inline with a quasi-quoter or in an
--   external file.
--   
--   Note there is no dependency on haskell-src-extras. Instead Shakespeare
--   believes logic should stay out of templates and has its own minimal
--   Haskell parser.
--   
--   Packages that use this: shakespeare-js, shakespeare-css,
--   shakespeare-text, hamlet, and xml-hamlet
--   
--   Please see the documentation at
--   http://www.yesodweb.com/book/shakespearean-templates for more
--   details.
@package shakespeare
@version 1.0.2

-- | General parsers, functions and datatypes for all Shakespeare
--   languages.
module Text.Shakespeare.Base
data Deref
DerefModulesIdent :: [String] -> Ident -> Deref
DerefIdent :: Ident -> Deref
DerefIntegral :: Integer -> Deref
DerefRational :: Rational -> Deref
DerefString :: String -> Deref
DerefBranch :: Deref -> Deref -> Deref
DerefList :: [Deref] -> Deref
DerefTuple :: [Deref] -> Deref
newtype Ident
Ident :: String -> Ident
type Scope = [(Ident, Exp)]
parseDeref :: Parser Deref
parseHash :: Parser (Either String Deref)
parseVar :: Char -> Parser (Either String Deref)
parseVarString :: Char -> Parser (Either String String)
parseAt :: Parser (Either String (Deref, Bool))
parseUrl :: Char -> Char -> Parser (Either String (Deref, Bool))
parseUrlString :: Char -> Char -> Parser (Either String String)
parseCaret :: Parser (Either String Deref)
parseUnder :: Parser (Either String Deref)
parseInt :: Char -> Parser (Either String Deref)
parseIntString :: Char -> Parser (Either String String)
derefToExp :: Scope -> Deref -> Exp
flattenDeref :: Deref -> Maybe [String]
readUtf8File :: FilePath -> IO Text
instance Typeable Ident
instance Typeable Deref
instance Show Ident
instance Eq Ident
instance Read Ident
instance Data Ident
instance Ord Ident
instance Show Deref
instance Eq Deref
instance Read Deref
instance Data Deref
instance Ord Deref
instance Lift Deref
instance Lift Ident

-- | For lack of a better name... a parameterized version of Julius.
module Text.Shakespeare
data ShakespeareSettings
ShakespeareSettings :: Char -> Char -> Char -> Exp -> Exp -> Exp -> Bool -> Maybe PreConvert -> Maybe Exp -> ShakespeareSettings
varChar :: ShakespeareSettings -> Char
urlChar :: ShakespeareSettings -> Char
intChar :: ShakespeareSettings -> Char
toBuilder :: ShakespeareSettings -> Exp
wrap :: ShakespeareSettings -> Exp
unwrap :: ShakespeareSettings -> Exp
justVarInterpolation :: ShakespeareSettings -> Bool
preConversion :: ShakespeareSettings -> Maybe PreConvert

-- | A transformation applied to the final expression. Most often, this
--   would be used to force the type of the expression to help make more
--   meaningful error messages.
modifyFinalValue :: ShakespeareSettings -> Maybe Exp

-- | The Coffeescript language compiles down to Javascript. Previously we
--   waited until the very end, at the rendering stage to perform this
--   compilation. Lets call is a post-conversion This had the advantage
--   that all Haskell values were inserted first: for example a value could
--   be inserted that Coffeescript would compile into Javascript. While
--   that is perhaps a safer approach, the advantage is not used in
--   practice: it was that way mainly for ease of implementation. The
--   down-side is the template must be compiled down to Javascript during
--   every request. If instead we do a pre-conversion to compile down to
--   Javascript, we only need to perform the compilation once. During the
--   pre-conversion we first modify all Haskell insertions so that they
--   will be ignored by the Coffeescript compiler (backticks). So %{var} is
--   change to `%{var}` using the preEscapeBegin and preEscapeEnd.
--   preEscapeIgnoreBalanced is used to not insert backtacks for variable
--   already inside strings or backticks. coffeescript will happily ignore
--   the interpolations, and backticks would not be treated as escaping in
--   that context. preEscapeIgnoreLine was added to ignore comments (which
--   in Coffeescript begin with a '#')
data PreConvert
PreConvert :: PreConversion -> String -> String -> [Char] -> [Char] -> PreConvert
preConvert :: PreConvert -> PreConversion
preEscapeBegin :: PreConvert -> String
preEscapeEnd :: PreConvert -> String
preEscapeIgnoreBalanced :: PreConvert -> [Char]
preEscapeIgnoreLine :: PreConvert -> [Char]
data PreConversion
ReadProcess :: String -> [String] -> PreConversion
Id :: PreConversion
defaultShakespeareSettings :: ShakespeareSettings
shakespeare :: ShakespeareSettings -> QuasiQuoter
shakespeareFile :: ShakespeareSettings -> FilePath -> Q Exp
shakespeareFileReload :: ShakespeareSettings -> FilePath -> Q Exp
shakespeareFromString :: ShakespeareSettings -> String -> Q Exp

-- | Determine which identifiers are used by the given template, useful for
--   creating systems like yesod devel.
shakespeareUsedIdentifiers :: ShakespeareSettings -> String -> [(Deref, VarType)]
type RenderUrl url = url -> QueryParameters -> Text
data VarType
data Deref
instance Show Content
instance Eq Content
instance Lift ShakespeareSettings
instance Lift PreConversion
instance Lift PreConvert
