diff options
Diffstat (limited to 'src/Text/BlazeT.hs')
-rw-r--r-- | src/Text/BlazeT.hs | 57 |
1 files changed, 37 insertions, 20 deletions
diff --git a/src/Text/BlazeT.hs b/src/Text/BlazeT.hs index b3e7c8d..ffdd89b 100644 --- a/src/Text/BlazeT.hs +++ b/src/Text/BlazeT.hs | |||
@@ -1,19 +1,24 @@ | |||
1 | {-# LANGUAGE UndecidableInstances #-} | 1 | {-# LANGUAGE UndecidableInstances #-} |
2 | {-# LANGUAGE FlexibleInstances #-} | 2 | {-# LANGUAGE FlexibleInstances #-} |
3 | {-# LANGUAGE RankNTypes #-} | 3 | {-# LANGUAGE RankNTypes #-} |
4 | |||
4 | module Text.BlazeT | 5 | module Text.BlazeT |
5 | ( | 6 | ( |
6 | -- * Important types. | 7 | -- * DO NOT READ THIS. READ "Text.BlazeT.Internal" INSTEAD |
8 | -- $descr | ||
9 | |||
10 | -- * DO NOT READ THIS | ||
11 | -- -- * Important types. | ||
7 | Markup | 12 | Markup |
8 | , Tag | 13 | , Tag |
9 | , Attribute | 14 | , Attribute |
10 | , AttributeValue | 15 | , AttributeValue |
11 | 16 | ||
12 | -- * Creating attributes. | 17 | -- -- * Creating attributes. |
13 | , dataAttribute | 18 | , dataAttribute |
14 | , customAttribute | 19 | , customAttribute |
15 | 20 | ||
16 | -- * Converting values to Markup. | 21 | -- -- * Converting values to Markup. |
17 | , ToMarkup (..) | 22 | , ToMarkup (..) |
18 | , text | 23 | , text |
19 | , preEscapedText | 24 | , preEscapedText |
@@ -24,19 +29,19 @@ module Text.BlazeT | |||
24 | , unsafeByteString | 29 | , unsafeByteString |
25 | , unsafeLazyByteString | 30 | , unsafeLazyByteString |
26 | 31 | ||
27 | -- * Comments | 32 | -- -- * Comments |
28 | , textComment | 33 | , textComment |
29 | , lazyTextComment | 34 | , lazyTextComment |
30 | , stringComment | 35 | , stringComment |
31 | , unsafeByteStringComment | 36 | , unsafeByteStringComment |
32 | , unsafeLazyByteStringComment | 37 | , unsafeLazyByteStringComment |
33 | 38 | ||
34 | -- * Creating tags. | 39 | -- -- * Creating tags. |
35 | , textTag | 40 | , textTag |
36 | , stringTag | 41 | , stringTag |
37 | 42 | ||
38 | -- * Converting values to attribute values. | 43 | -- -- * Converting values to attribute values. |
39 | , B.ToValue (..) | 44 | , Text.Blaze.ToValue (..) |
40 | , textValue | 45 | , textValue |
41 | , preEscapedTextValue | 46 | , preEscapedTextValue |
42 | , lazyTextValue | 47 | , lazyTextValue |
@@ -46,28 +51,28 @@ module Text.BlazeT | |||
46 | , unsafeByteStringValue | 51 | , unsafeByteStringValue |
47 | , unsafeLazyByteStringValue | 52 | , unsafeLazyByteStringValue |
48 | 53 | ||
49 | -- * Setting attributes | 54 | -- -- * Setting attributes |
50 | , (!) | 55 | , (!) |
51 | , (!?) | 56 | , (!?) |
52 | 57 | ||
53 | -- * Modifiying Markup trees | 58 | -- -- * Modifiying Markup trees |
54 | , contents | 59 | , contents |
55 | 60 | ||
56 | -- * BlazeT new stuff | 61 | ,MarkupT(..) |
62 | ,MarkupI | ||
63 | ,mapMarkupT | ||
57 | ,MarkupM | 64 | ,MarkupM |
58 | ,Markup2 | 65 | ,Markup2 |
59 | ,mapMarkupT | ||
60 | ,MarkupT | ||
61 | ,runMarkup | ||
62 | ,runMarkupT | 66 | ,runMarkupT |
63 | ,execMarkup | 67 | ,runMarkup |
64 | ,execMarkupT | ||
65 | ,runWith | 68 | ,runWith |
69 | ,execMarkupT | ||
70 | ,execMarkup | ||
66 | ,execWith | 71 | ,execWith |
67 | ) where | 72 | ) where |
68 | 73 | ||
69 | import qualified Text.Blaze as B | 74 | import qualified Text.Blaze |
70 | import Text.BlazeT.Internal | 75 | import Text.BlazeT.Internal as Text.BlazeT.Internal |
71 | 76 | ||
72 | class ToMarkup a where | 77 | class ToMarkup a where |
73 | toMarkup :: a -> Markup | 78 | toMarkup :: a -> Markup |
@@ -76,8 +81,20 @@ class ToMarkup a where | |||
76 | -- test :: (ToMarkup a, Monad m) => a -> MarkupT m () | 81 | -- test :: (ToMarkup a, Monad m) => a -> MarkupT m () |
77 | -- test = toMarkup | 82 | -- test = toMarkup |
78 | 83 | ||
79 | instance B.ToMarkup a => ToMarkup a where | 84 | instance Text.Blaze.ToMarkup a => ToMarkup a where |
80 | toMarkup = wrapMarkup . B.toMarkup | 85 | toMarkup = wrapMarkup . Text.Blaze.toMarkup |
81 | {-# INLINE toMarkup #-} | 86 | {-# INLINE toMarkup #-} |
82 | preEscapedToMarkup = wrapMarkup . B.preEscapedToMarkup | 87 | preEscapedToMarkup = wrapMarkup . Text.Blaze.preEscapedToMarkup |
83 | {-# INLINE preEscapedToMarkup #-} | 88 | {-# INLINE preEscapedToMarkup #-} |
89 | |||
90 | |||
91 | -- $descr | ||
92 | -- | ||
93 | -- Due due a Haddock bug, this documentation is misleading. Please | ||
94 | -- read "Text.BlazeT.Internal" instead. | ||
95 | -- | ||
96 | -- (The bug shows both @Text.Blaze.Markup@ and @Text.BlazeT.Markup@ as | ||
97 | -- "Markup".) | ||
98 | -- | ||
99 | -- Use this documentation only to see which entities are exported by | ||
100 | -- this module. | ||