- hamlet :: QuasiQuoter
- hamletWithSettings :: HamletSettings -> QuasiQuoter
- data HamletSettings = HamletSettings {}
- defaultHamletSettings :: HamletSettings
- newtype Hamlet url m a = Hamlet {}
- data HtmlContent
- printHamlet :: (url -> String) -> Hamlet url IO () -> IO ()
- newtype Enumerator val m = Enumerator {
- runEnumerator :: forall seed. Iteratee val seed m -> seed -> m (Either seed seed)
- fromList :: Monad m => [a] -> Enumerator a m
Documentation
Calls hamletWithSettings
with defaultHamletSettings
.
hamletWithSettings :: HamletSettings -> QuasiQuoterSource
A quasi-quoter that converts Hamlet syntax into a function of form:
argument -> Hamlet url m ()
Please see accompanying documentation for a description of Hamlet syntax. You must ensure that the type of m, url and argument all work properly with the functions referred to in the template. Of course, worst case scenario is the compiler will catch your mistakes.
data HamletSettings Source
Settings for parsing of a hamlet document.
HamletSettings | |
|
defaultHamletSettings :: HamletSettingsSource
Defaults settings: HTML5 doctype and HTML-style empty tags.
Hamlet
is a monad that has two features:
- It passes along a function to convert a URL to a
String
. - It keeps an
Iteratee
and a seed value so that it can output values. Output is all done through a strictText
value.
The URL to String function makes it very convenient to write templates without knowing the absolute URLs for all referenced resources. For more information on this approach, please see the web-routes package.
For efficiency, the Hamlet
monad halts execution as soon as the underlying
Iteratee
returns a Left
value. This is normally what you want; this
might cause a problem if you are relying on the side effects of a Hamlet
action. However, it is not recommended to rely on side-effects. Though a
Hamlet
monad may perform IO actions, this should only be used for
read-only behavior for efficiency.
data HtmlContent Source
printHamlet :: (url -> String) -> Hamlet url IO () -> IO ()Source
Prints a Hamlet to standard out. Good for debugging.
newtype Enumerator val m Source
Generates a stream of values to be passed to an Iteratee
.
Enumerator | |
|
fromList :: Monad m => [a] -> Enumerator a mSource
Convert a list into an Enumerator
.