Menu
  • HOME
  • TAGS

Is there a way to pass a Hamlet block as an argument to a function?

haskell,yesod,hamlet

No, such syntax does not exist.

SVG tags in hamlet shakespearean (yesod/haskell) templates?

haskell,yesod,hamlet

You can just include it like any other tags. Don't put spaces before and after equals sign. <svg height="50" width="500">...

How can I embed both Text and Widget in another Widget in Yesod?

haskell,yesod,hamlet

I wouldn't go this route, specifically because of the type inference issue you already discovered. Explicitly having to call toWidget occasionally is probably the best compromise here.

Yesod's shakespearean templates (hamlet) and IO

haskell,yesod,hamlet,io-monad

Hamlet is just providing an alternate syntax for normal Haskell code, so like normal Haskell, you have to keep your impure actions separate. In other words, you need to run the IO action outside of the template.

Yesod Mform and hamlet

yesod,hamlet,yesod-forms

I got it. I was not clear of what "tableMform extra" has to return. I know that it has to return something of type [(FormResult a, xml)][1] . But then I was not sure what the type of "forM lis ((w,h) -> mopt intField (fromString w) (Just h) )" --...

Missing imports from Hamlet libraries

haskell,yesod,template-haskell,hamlet

Import Yesod.Core and Yesod.Core.Widget, they will provide the appropriate functions. Also note that they have a online version of the book. And generally if you see import errors, do a search on Hoogle and in most of the cases you are likely to find a solution there....

compile-time vs. run-time cost of Hamlet templates

haskell,yesod,hamlet

It's been a while since I worked on the code, so don't take this as authoratative (like Daniel mentioned, -ddump-simpl is a good call here). But I don't believe we're using the blaze-html combinators, just the data type. Hamlet itself concatenates strings as much as possible at compile time to...