I am building a survey site in Yesod (0.10) and am getting lost in the types. Here is a simplified version on what I am trying to do.
invitation url = do
render <- getUrlRender
return $ renderHtml [hamlet|
<p>Dear foo, please take our
<a href=@{ShowSurveyR url}>survey.
|] render
Another function is going to call this in hopes of getting something that can be passed to simpleMail from Network.Mail.Mime. The above function gives a type error:
Handler/Root.hs:404:13:
The function `renderHtml' is applied to two arguments,
but its type `Html -> LT.Text' has only one
This is confusing, because the templates tutorial seems to do things this way. But if I modify the code, like this...
invitation url = do
return $ renderHtml [hamlet|
<p>Dear foo, please take our
<a href=@{ShowSurveyR url}>survey.
|]
I get this type error.
Handler/Root.hs:403:24:
The lambda expression `\ _render[a4TO] -> ...' has one argument,
but its type `Html' has none
In the first argument of `renderHtml', namely
I think that renderHtml is the wrong function to use, but I can't find what the right function is. Does anyone know what I am missing? How am I supposed to pass the routing function into my hamlet code?