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)]