[Haskell-cafe] ANN: nice-html, an all-around "nice" html templating library, similar but different to lucid, blaze, type-of-html, etc.
Saurabh Nanda
saurabhnanda at gmail.com
Wed Nov 8 09:06:07 UTC 2017
>
> >Do you mind explaining the invalid monad instance of Lucid and how it
> would impact a library user?
> To my knowledge lucid uses a monad instance that follow the monad laws
> (what I meant by "valid") fine.
>
Sorry for causing the confusion. I misread that statement in your README.
> >Also, I'm assuming one shouldn't call the `compile` function each time a
> page needs to be rendered, right? Should one put the results of the
> `compile` function in a top-level Map and use those to get the speed gains?
> The idea is to only compile a template once, ever. If you need to compile
> a template every time a page is rendered (though I can't actually think of
> a case where you would), you should probably just skip the middle-man, and
> use lucid (or blaze). It's not horribly slow, but you'd miss out on the
> benefits of nice-html by doing this.
>
So, I guess my question was, how does one compile a template exactly once
with `nice-html` ? If some content inside the template is conditional based
on input values, will it work properly, as expected?
-- Saurabh.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20171108/ead475e1/attachment.html>
More information about the Haskell-Cafe
mailing list