Add HTML5 rendition of Head.
[doclang.git] / Language / TCT / Elem.hs
index 9bf670345fa29dd8fa52a6fc89052efee4fa3908..4e30138b9f17b940fa77db13420503207008a7e9 100644 (file)
@@ -1,35 +1,25 @@
 module Language.TCT.Elem where
 
 import Data.Eq (Eq)
-import Data.Semigroup (Semigroup(..))
-import Data.String (String)
-import Data.Text (Text)
+import Data.Ord (Ord)
 import Text.Show (Show(..))
+import qualified Data.Text.Lazy as TL
 
--- import Debug.Trace (trace)
-trac :: String -> a -> a
-trac _m x = x
-{-# INLINE trac #-}
--- trac m x = trace m x
-dbg :: Show a => String -> a -> a
-dbg m x = trac (m <> ": " <> show x) x
-{-# INLINE dbg #-}
+-- * Type 'ElemName'
+type ElemName = TL.Text
 
--- * Type 'Elem'
-type Elem = Text
-
--- ** Type 'Attr'
-data Attr
- =   Attr
- {   attr_name  :: Text
- ,   attr_open  :: Text
- ,   attr_value :: Text
- ,   attr_close :: Text
+-- ** Type 'ElemAttr'
+data ElemAttr
+ =   ElemAttr
+ {   elemAttr_name  :: !TL.Text
+ ,   elemAttr_open  :: !TL.Text
+ ,   elemAttr_value :: !TL.Text
+ ,   elemAttr_close :: !TL.Text
  }
- deriving (Eq,Show)
+ deriving (Eq,Ord,Show)
 
 -- ** Type 'White'
-type White = Text
+type White = TL.Text
 
--- ** Type 'Attrs'
-type Attrs = [(White,Attr)]
+-- ** Type 'ElemAttrs'
+type ElemAttrs = [(White,ElemAttr)]