[web-devel] Yesod. Hamlet problems

Anton Cheshkov acheshkov at gmail.com
Tue Mar 15 20:28:44 CET 2011


Hello Michael.  Hello All.

Please help me to explain  what is wrong

i have a function which worked before i add line *<img src="StaticR p1_png">
* :

*toHamlet :: [SearchResult] -> String - > Int -> Html*
*toHamlet results queryId n = [$hamlet|*
*$forall r <- results*
*    <div #search-result-block qid="#{queryId}" piece="#{show n}">*
*        <div .image-block .left>*
*           <img src="StaticR p1_png">*
*        <div .info1-block .left>*
*            <span>#{snd $ snd r}*
*        <div .info2-block .left>*
*        <div .clear>*
*|]*

I have the compile time error:

*Couldn't match expected type
`hamlet-0.7.1:Text.Hamlet.Quasi.R:HamletUrlHtmlM'*
*           against inferred type `EstateRoute'*
*    In the first argument of `\ u[ahZb]*
*                                  ->
hamlet-0.7.1:Text.Hamlet.Quasi.urlToHamletMonad*
*                                       u[ahZb] []', namely*
*        `StaticR p1_png'*
*    In a stmt of a 'do' expression:*
*        \ u[ahZb]*
*            -> hamlet-0.7.1:Text.Hamlet.Quasi.urlToHamletMonad u[ahZb] []*
*          (StaticR p1_png)*
*    In the expression:*
*        do { (hamlet-0.7.1:Text.Hamlet.Quasi.htmlToHamletMonad*
*            . preEscapedString)*
*               "<div id=\"search-result-block\" qid=\"";*
*             (hamlet-0.7.1:Text.Hamlet.Quasi.htmlToHamletMonad*
*            . Text.Blaze.toHtml)*
*               queryId;*
*             (hamlet-0.7.1:Text.Hamlet.Quasi.htmlToHamletMonad*
*            . preEscapedString)*
*               "\" piece=\"";*
*             (hamlet-0.7.1:Text.Hamlet.Quasi.htmlToHamletMonad*
*            . Text.Blaze.toHtml)*
*               (show n);*
*             .... }*

I do not understand why (.

Thanks.

-- 
Best regards,
Cheshkov Anton
Phone: +7 909 005 18 82
Skype: cheshkov_anton
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/web-devel/attachments/20110316/3c1ab35e/attachment.htm>


More information about the web-devel mailing list