[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
Thu Oct 26 12:51:04 UTC 2017

Thank you for putting comparisons and benchmarks, upfront.

Do you mind explaining the invalid monad instance of Lucid and how it would
impact a library user?

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?

Side comment, the use of `dynamic` makes it look similar to reflex `dyn*`

-- Saurabh.

On Thu, Oct 26, 2017 at 4:15 PM, Mike Ledger <eleventynine at gmail.com> wrote:

> Hi Haskell-Cafe,
> I've been working on and off on a HTML templating library that is slightly
> novel for a few months.
> Here's the good parts:
> * it's faster than lucid and blaze
> * it has a valid monad instance
> * it has another valid monad instance, that is slightly different!
> * it paramaterises templates by the data they require
> * the HTML5 combinators don't rely on any highly overloaded/overlapping
> typeclasses; type errors in nice-html templates tend to be nice monomorphic
> type mismatches
> To achieve this, it has a distinct compilation phase (at runtime) for
> templates. This means the actual rendering function does very little beyond
> concatenate Text and escape dynamic input. It also severely restricts usage
> to the built-in combinators available -- at least, for dynamic data -- and
> can make writing a nice-html template difficult, though littering _
> throughout type signatures helps.
> Check it out!
> Benchmark results, a README, and an example: https://github.com/
> TransportEngineering/nice-html
> Hackage: https://hackage.haskell.org/package/nice-html
> The only thing on the roadmap right now is to have some nice :-) way to
> assign JavaScript event handlers to Markup. This is something that I really
> appreciate when using React.js, so my eventual aim is for nice-html to be
> like a (more) server-side version of React. Right now, you can keep track
> of element ids with `Text.Html.Writer.note`, but it's neither a very good
> nor very useful interface.
> Cheers,
> Mike
> _______________________________________________
> Haskell-Cafe mailing list
> To (un)subscribe, modify options or view archives go to:
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
> Only members subscribed via the mailman list are allowed to post.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20171026/a8a57c07/attachment.html>

More information about the Haskell-Cafe mailing list