type-of-html: High performance type driven html generation.

[ bsd3, html, language, library, text, web ] [ Propose Tags ]

This library makes most invalid html documents compile time errors and uses advanced type level features to realise compile time computations.


[Skip to Readme]
Versions [faq] 0.2.1.1, 0.3.0.0, 0.4.0.0, 0.4.0.1, 0.4.1.1, 0.5.0.0, 0.5.1.0, 0.5.1.1, 0.5.1.2, 1.0.0.0, 1.0.1.0, 1.0.1.1, 1.1.0.0, 1.2.0.0, 1.3.0.0, 1.3.0.1, 1.3.1.0, 1.3.1.1, 1.3.2.0, 1.3.2.1, 1.3.3.0, 1.3.3.1, 1.3.3.2, 1.3.4.0, 1.4.0.0, 1.4.0.1, 1.4.0.2, 1.4.1.0, 1.5.0.0, 1.5.1.0, 1.5.2.0, 1.6.0.0, 1.6.1.0, 1.6.1.1, 1.6.1.2, 1.6.2.0
Change log ChangeLog.md
Dependencies base (==4.10.*), bytestring, text [details]
License BSD-3-Clause
Copyright 2017, Florian Knupfer
Author Florian Knupfer
Maintainer fknupfer@gmail.com
Category Language
Home page https://github.com/knupfer/type-of-html
Source repo head: git clone https://github.com/knupfer/type-of-html
Uploaded by knupfer at 2017-09-09T22:25:44Z
Distributions LTSHaskell:1.5.0.0, NixOS:1.6.1.2, Stackage:1.5.0.0
Downloads 15626 total (436 in the last 30 days)
Rating 2.25 (votes: 2) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs uploaded by user
Build status unknown [no reports yet]

Modules

[Index]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees


Readme for type-of-html-0.4.1.1

[back to package description]

Type of html

Type of html is a library for generating html in a highly performant and type safe manner.

Please read the documentation of the module: Html

Note that you need at least ghc 8.2.

Typesafety

Part of the html spec is encoded at the typelevel, turning a lot of mistakes into type errors.

Performance

Type of html is normally a lot faster than blaze html. Criterion says about the following snippet that Type of html needs only ~450 ns, blaze html needs ten times more time.

example x =
  html_
    ( body_
      ( h1_
        ( img_
        # strong_ "0"
        )
      # div_
        ( div_ "1"
        )
      # div_
        ( form_
          ( fieldset_
            ( div_
              ( div_
                ( label_ "a"
                # select_
                  ( option_ "b"
                  # option_ "c"
                  )
                # div_ "d"
                )
              # i_ x
              )
            # button_ (i_ "e")
            )
          )
        )
      )
    )