]> Git — Sourcephile - doclang.git/blob - Language/TCT/Elem.hs
Add Data.Locale.
[doclang.git] / Language / TCT / Elem.hs
1 module Language.TCT.Elem where
2
3 import Data.Eq (Eq)
4 import Data.Ord (Ord)
5 import Data.Semigroup (Semigroup(..))
6 import Data.String (String)
7 import Data.Text (Text)
8 import Text.Show (Show(..))
9
10 -- import Debug.Trace (trace)
11 trac :: String -> a -> a
12 trac _m x = x
13 -- trac m x = trace m x
14 {-# INLINE trac #-}
15 dbg :: Show a => String -> a -> a
16 dbg m x = trac (m <> ": " <> show x) x
17 {-# INLINE dbg #-}
18
19 -- * Type 'Elem'
20 type Elem = Text
21
22 -- ** Type 'Attr'
23 data Attr
24 = Attr
25 { attr_name :: !Text
26 , attr_open :: !Text
27 , attr_value :: !Text
28 , attr_close :: !Text
29 }
30 deriving (Eq,Ord,Show)
31
32 -- ** Type 'White'
33 type White = Text
34
35 -- ** Type 'Attrs'
36 type Attrs = [(White,Attr)]