postSplice :: Splice m

renderPost :: Monad m => Post -> Splice m renderPost post = do runChildrenWithText [("postTitle", postTitle post) ,("postBody", postBody post)]

renderPosts :: Monad m => [Post] -> Splice m renderPosts = mapSplices renderPost

recentPostsSplice :: Splice Application recentPostsSplice = getRecentPosts >>= renderPosts

postsWithTag :: Text -> Splice Application postsWithTag tag = getTaggedPosts tag >>= renderPosts postsWithTagSplice :: Splice Application postsWithTagSplice = do node <- getParamNode maybe (return []) postsWithTag $ getAttribute "tag" node

<postsWithTag tag="heist"/>

postsWithTagSplice :: Splice Application postsWithTagSplice = do tag <- lift $ getParam "tag" maybe (return []) postsWithTag tag

<recentPosts> <h1><postTitle/></h1> <div><postBody/></div> </recentPosts>