Conversion of Haskell source code to HTML
As part of the
Programatica
Haskell front-end,
we have implemented a conversion of Haskell source code to HTML, which is in an
experimental state at the moment. Nevertheless,
we applied it to some sample nontrivial Haskell programs, and here
is what the result looks like.
Information added in the translation
- Keywords
(like
import
,
data
,
let
and
if
),
literals
(like 42
and
"Hello"
)
and identifiers are colored.
Unlike the syntax highlighting modes of text editors like Emacs and Vim,
this translator knows the difference between
type constructors
(like Int
,
Bool
,
Maybe
and
IO
)
and data constructors
(like
True
,
Nothing
and
Just
).
Colors are controlled by a style sheet.
- Identifiers are linked to their definition.
A popup also shows some information about the identifier, e.g.,
which type a constructor belongs to or which class a method belongs to.
- Comments are highlighted. You can also use a simple markup language
in comments to generate nicer looking HTML.
Limitations
- The source has to be syntactically correct.
- The translator needs the source of all referenced modules,
including the Prelude and all library modules.
Thomas Hallgren
(March 2002, updated June 2013)