[Haskell-cafe] ANN: nice-html, an all-around "nice" html templating library, similar but different to lucid, blaze, type-of-html, etc.

Mike Ledger eleventynine at gmail.com
Thu Oct 26 10:45:37 UTC 2017

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:
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.

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

More information about the Haskell-Cafe mailing list