[Haskell-cafe] ANN: moe html combinator

Jinjing Wang nfjinjing at gmail.com
Fri Aug 28 01:08:58 EDT 2009


hand written html is fine, except for the closing tags:

what if

      html' - do
        head' - do
          meta
            [http_equiv "Content-Type", content "text/html; charset-utf-8"] (/)
          title' - str "my title"
          link [rel "icon", _type "image/png", href "panda_icon.png"] (/)

        body' - do
          div [_class "container"] - do
            str "hello world"

produces

    <html>
      <head>
        <meta http-equiv="Content-Type" content="text/html; charset-utf-8">
        </meta>
        <title>
          my title
        </title>
        <link rel="icon" type="image/png" href="panda_icon.png">
        </link>
      </head>
      <body>
        <div class="container">
          hello world
        </div>
      </body>
    </html>

That's moe. There's also extra dsl sugar / flavors for your
convienence, including (currently available) markdown and kawaii.

It's a new library, tries to bring some haskell fun back to web
programming, so .. enjoy.

- moe: http://hackage.haskell.org/package/moe

-- 
jinjing


More information about the Haskell-Cafe mailing list