]> Git — Sourcephile - doclang.git/blob - Hdoc/RNC.hs
XML: use symantic-xml
[doclang.git] / Hdoc / RNC.hs
1 {-# LANGUAGE OverloadedStrings #-}
2 module Hdoc.RNC where
3 import Data.Bool (Bool)
4 import Data.Int (Int)
5 import Data.Monoid (Monoid(..))
6 import Data.Ratio (Rational)
7 import qualified Data.Text.Lazy as TL
8 import qualified Language.Symantic.RNC as RNC
9 import qualified Language.Symantic.RNC.Write as RNC
10
11 import Hdoc.Utils (Nat, Nat1)
12
13 -- * Class 'Sym_RNC_Extra'
14 class RNC.Sym_RNC repr => Sym_RNC_Extra repr where
15 comment :: repr TL.Text
16 none :: repr ()
17 bool :: repr Bool
18 int :: repr Int
19 nat :: repr Nat
20 nat1 :: repr Nat1
21 rational :: repr Rational
22 rationalPositive :: repr Rational
23 instance Sym_RNC_Extra RNC.NS where
24 comment = mempty
25 none = mempty
26 bool = mempty
27 int = mempty
28 nat = mempty
29 nat1 = mempty
30 rational = mempty
31 rationalPositive = mempty
32 instance Sym_RNC_Extra RNC.Writer where
33 comment = RNC.writeText "comment"
34 none = RNC.writeText "empty"
35 bool = RNC.writeText "bool"
36 int = RNC.writeText "xsd:int" -- FIXME: is it useful to use the xsd: namespace?
37 nat = RNC.writeText "nat"
38 nat1 = RNC.writeText "nat1"
39 rational = RNC.writeText "rational"
40 rationalPositive = RNC.writeText "rationalPositive"