{-# LANGUAGE OverloadedStrings #-} module Hdoc.RNC where import Data.Bool (Bool) import Data.Int (Int) import Data.Monoid (Monoid(..)) import Data.Ratio (Rational) import qualified Data.Text.Lazy as TL import qualified Language.Symantic.RNC as RNC import qualified Language.Symantic.RNC.Write as RNC import Hdoc.Utils (Nat, Nat1) -- * Class 'Sym_RNC_Extra' class RNC.Sym_RNC repr => Sym_RNC_Extra repr where comment :: repr TL.Text none :: repr () bool :: repr Bool int :: repr Int nat :: repr Nat nat1 :: repr Nat1 rational :: repr Rational rationalPositive :: repr Rational instance Sym_RNC_Extra RNC.NS where comment = mempty none = mempty bool = mempty int = mempty nat = mempty nat1 = mempty rational = mempty rationalPositive = mempty instance Sym_RNC_Extra RNC.Writer where comment = RNC.writeText "comment" none = RNC.writeText "empty" bool = RNC.writeText "bool" int = RNC.writeText "xsd:int" -- FIXME: is it useful to use the xsd: namespace? nat = RNC.writeText "nat" nat1 = RNC.writeText "nat1" rational = RNC.writeText "rational" rationalPositive = RNC.writeText "rationalPositive"