[Haskell] Progress in StaticDTD
Marcel Manthe
m at tel.netbeisser.de
Wed Jul 18 18:01:13 EDT 2007
Hello,
in StaticDTD we are moving to complete statical validness against a DTD.
For a (compile time) function that uses our generic combinators, we can
garuantee the following:
- The content model for each element is enforced (this is done by checking
a type-level determined finite automaton for each content model)
- The attributes are validated (not so their values yet). The check function
facilitates a type-level mergesort algorithm.
We are using a HList like structure and so these garuantees also hold with
higher order functions.
The implementation can be found at
http://m13s07.vlinux.de/darcs/StaticDTD/v2
It is a mess and all of the infrastructure around it is still missing, but
it shows that the concept might work.
We hope to have a well-working release in very few months.
Some words about related work:
- WASH/HTML [1] was the original inspiration for us. It checks proper
nesting of
elements, but not the content model. It is a HTML, not a 'all DTDs of
XML'
library
- HaXml [2] has two modes: one with generic combinators, which are not
type-safe
in respect to a DTD, and one where validity is enforced by regex-like
Haskell abstract data types. With them, pattern matching can be used.
- HSXML [3] has generic combinators and checkes for some
nesting-properties.
- BinaryNumbers.hs [4] is a great type-level implemention of numeric
calculation
and we are using it in our library for defining complete order and
enumerate
the states of a DFA.
As a side-effect of our work we hope to put the type-level functions in a
small seperate 'type-level programming' library, for common use.
Comments are very welcome.
Marcel Manthe
[1] http://www.informatik.uni-freiburg.de/~thiemann/WASH/#washhtml
[2] http://www.cs.york.ac.uk/fp/HaXml/
[3] http://okmij.org/ftp/Scheme/xml.html#typed-SXML
[4] http://okmij.org/ftp/Haskell/types.html#binary-arithm
--
View this message in context: http://www.nabble.com/Progress-in-StaticDTD-tf4106801.html#a11678520
Sent from the Haskell - Haskell mailing list archive at Nabble.com.
More information about the Haskell
mailing list