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