MkOneOf takes an integer N or an integer range N M and writes to the standard output a Haskell module with respectively the datatype OneOfN or the datatypes OneOfN up to and including OneOfM.
module Text.XML.HaXml.OneOfN where import Text.XML.HaXml.Xml2Haskell data OneOf1 a = OneOf1 a deriving (Eq,Show) instance (XmlContent a) => XmlContent (OneOf1 a) where fromElem cs = (choice OneOf1 $ (->(Nothing,c))) cs toElem (OneOf1 x) = toElem x ---- data OneOf2 a b = OneOf2 a | TwoOf2 b deriving (Eq,Show) instance (XmlContent a,XmlContent b) => XmlContent (OneOf2 a b) where fromElem cs = (choice OneOf2 $ choice TwoOf2 $ (->(Nothing,c))) cs toElem (OneOf2 x) = toElem x toElem (TwoOf2 x) = toElem x ----
The HaXml library is licensed under the terms of the GNU Lesser General Public Licence (LGPL), with the following special exception:
As a relaxation of clause 6 of the LGPL, the copyright holders of this library give permission to use, copy, link, modify, and distribute, binary-only object-code versions of an executable linked with the Library, without requiring the supply of any mechanism to modify or replace the Library and relink (clauses 6a, 6b, 6c, 6d, 6e), provided that all the other terms of clause 6 are complied with.
The HaXml tools Xtract, Validate, DtdToHaskell, and MkOneOf, are licensed under the terms of the GNU General Public Licence (GPL).
This library and toolset is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Licences for more details.