/usr/share/doc/libghc-blaze-markup-doc/html/src/Text-Blaze-Internal.html is in libghc-blaze-markup-doc 0.8.0.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 | <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<!-- Generated by HsColour, http://code.haskell.org/~malcolm/hscolour/ -->
<title>src/Text/Blaze/Internal.hs</title>
<link type='text/css' rel='stylesheet' href='hscolour.css' />
</head>
<body>
<pre><a name="line-1"></a><span class='hs-comment'>{-# LANGUAGE CPP #-}</span>
<a name="line-2"></a><span class='hs-comment'>{-# LANGUAGE DeriveDataTypeable #-}</span>
<a name="line-3"></a><span class='hs-comment'>{-# LANGUAGE ExistentialQuantification #-}</span>
<a name="line-4"></a><span class='hs-comment'>{-# LANGUAGE FlexibleInstances #-}</span>
<a name="line-5"></a><span class='hs-comment'>{-# LANGUAGE GADTs #-}</span>
<a name="line-6"></a><span class='hs-comment'>{-# LANGUAGE GeneralizedNewtypeDeriving #-}</span>
<a name="line-7"></a><span class='hs-comment'>{-# LANGUAGE OverloadedStrings #-}</span>
<a name="line-8"></a><span class='hs-comment'>{-# LANGUAGE Rank2Types #-}</span>
<a name="line-9"></a><span class='hs-comment'>-- | The BlazeMarkup core, consisting of functions that offer the power to</span>
<a name="line-10"></a><span class='hs-comment'>-- generate custom markup elements. It also offers user-centric functions,</span>
<a name="line-11"></a><span class='hs-comment'>-- which are exposed through 'Text.Blaze'.</span>
<a name="line-12"></a><span class='hs-comment'>--</span>
<a name="line-13"></a><span class='hs-comment'>-- While this module is exported, usage of it is not recommended, unless you</span>
<a name="line-14"></a><span class='hs-comment'>-- know what you are doing. This module might undergo changes at any time.</span>
<a name="line-15"></a><span class='hs-comment'>--</span>
<a name="line-16"></a><span class='hs-keyword'>module</span> <span class='hs-conid'>Text</span><span class='hs-varop'>.</span><span class='hs-conid'>Blaze</span><span class='hs-varop'>.</span><span class='hs-conid'>Internal</span>
<a name="line-17"></a> <span class='hs-layout'>(</span>
<a name="line-18"></a> <span class='hs-comment'>-- * Important types.</span>
<a name="line-19"></a> <span class='hs-conid'>ChoiceString</span> <span class='hs-layout'>(</span><span class='hs-keyglyph'>..</span><span class='hs-layout'>)</span>
<a name="line-20"></a> <span class='hs-layout'>,</span> <span class='hs-conid'>StaticString</span> <span class='hs-layout'>(</span><span class='hs-keyglyph'>..</span><span class='hs-layout'>)</span>
<a name="line-21"></a> <span class='hs-layout'>,</span> <span class='hs-conid'>MarkupM</span> <span class='hs-layout'>(</span><span class='hs-keyglyph'>..</span><span class='hs-layout'>)</span>
<a name="line-22"></a> <span class='hs-layout'>,</span> <span class='hs-conid'>Markup</span>
<a name="line-23"></a> <span class='hs-layout'>,</span> <span class='hs-conid'>Tag</span>
<a name="line-24"></a> <span class='hs-layout'>,</span> <span class='hs-conid'>Attribute</span>
<a name="line-25"></a> <span class='hs-layout'>,</span> <span class='hs-conid'>AttributeValue</span>
<a name="line-26"></a>
<a name="line-27"></a> <span class='hs-comment'>-- * Creating custom tags and attributes.</span>
<a name="line-28"></a> <span class='hs-layout'>,</span> <span class='hs-varid'>customParent</span>
<a name="line-29"></a> <span class='hs-layout'>,</span> <span class='hs-varid'>customLeaf</span>
<a name="line-30"></a> <span class='hs-layout'>,</span> <span class='hs-varid'>attribute</span>
<a name="line-31"></a> <span class='hs-layout'>,</span> <span class='hs-varid'>dataAttribute</span>
<a name="line-32"></a> <span class='hs-layout'>,</span> <span class='hs-varid'>customAttribute</span>
<a name="line-33"></a>
<a name="line-34"></a> <span class='hs-comment'>-- * Converting values to Markup.</span>
<a name="line-35"></a> <span class='hs-layout'>,</span> <span class='hs-varid'>text</span>
<a name="line-36"></a> <span class='hs-layout'>,</span> <span class='hs-varid'>preEscapedText</span>
<a name="line-37"></a> <span class='hs-layout'>,</span> <span class='hs-varid'>lazyText</span>
<a name="line-38"></a> <span class='hs-layout'>,</span> <span class='hs-varid'>preEscapedLazyText</span>
<a name="line-39"></a> <span class='hs-layout'>,</span> <span class='hs-varid'>textBuilder</span>
<a name="line-40"></a> <span class='hs-layout'>,</span> <span class='hs-varid'>preEscapedTextBuilder</span>
<a name="line-41"></a> <span class='hs-layout'>,</span> <span class='hs-varid'>string</span>
<a name="line-42"></a> <span class='hs-layout'>,</span> <span class='hs-varid'>preEscapedString</span>
<a name="line-43"></a> <span class='hs-layout'>,</span> <span class='hs-varid'>unsafeByteString</span>
<a name="line-44"></a> <span class='hs-layout'>,</span> <span class='hs-varid'>unsafeLazyByteString</span>
<a name="line-45"></a>
<a name="line-46"></a> <span class='hs-comment'>-- * Comments</span>
<a name="line-47"></a> <span class='hs-layout'>,</span> <span class='hs-varid'>textComment</span>
<a name="line-48"></a> <span class='hs-layout'>,</span> <span class='hs-varid'>lazyTextComment</span>
<a name="line-49"></a> <span class='hs-layout'>,</span> <span class='hs-varid'>stringComment</span>
<a name="line-50"></a> <span class='hs-layout'>,</span> <span class='hs-varid'>unsafeByteStringComment</span>
<a name="line-51"></a> <span class='hs-layout'>,</span> <span class='hs-varid'>unsafeLazyByteStringComment</span>
<a name="line-52"></a>
<a name="line-53"></a> <span class='hs-comment'>-- * Converting values to tags.</span>
<a name="line-54"></a> <span class='hs-layout'>,</span> <span class='hs-varid'>textTag</span>
<a name="line-55"></a> <span class='hs-layout'>,</span> <span class='hs-varid'>stringTag</span>
<a name="line-56"></a>
<a name="line-57"></a> <span class='hs-comment'>-- * Converting values to attribute values.</span>
<a name="line-58"></a> <span class='hs-layout'>,</span> <span class='hs-varid'>textValue</span>
<a name="line-59"></a> <span class='hs-layout'>,</span> <span class='hs-varid'>preEscapedTextValue</span>
<a name="line-60"></a> <span class='hs-layout'>,</span> <span class='hs-varid'>lazyTextValue</span>
<a name="line-61"></a> <span class='hs-layout'>,</span> <span class='hs-varid'>preEscapedLazyTextValue</span>
<a name="line-62"></a> <span class='hs-layout'>,</span> <span class='hs-varid'>textBuilderValue</span>
<a name="line-63"></a> <span class='hs-layout'>,</span> <span class='hs-varid'>preEscapedTextBuilderValue</span>
<a name="line-64"></a> <span class='hs-layout'>,</span> <span class='hs-varid'>stringValue</span>
<a name="line-65"></a> <span class='hs-layout'>,</span> <span class='hs-varid'>preEscapedStringValue</span>
<a name="line-66"></a> <span class='hs-layout'>,</span> <span class='hs-varid'>unsafeByteStringValue</span>
<a name="line-67"></a> <span class='hs-layout'>,</span> <span class='hs-varid'>unsafeLazyByteStringValue</span>
<a name="line-68"></a>
<a name="line-69"></a> <span class='hs-comment'>-- * Setting attributes</span>
<a name="line-70"></a> <span class='hs-layout'>,</span> <span class='hs-conid'>Attributable</span>
<a name="line-71"></a> <span class='hs-layout'>,</span> <span class='hs-layout'>(</span><span class='hs-varop'>!</span><span class='hs-layout'>)</span>
<a name="line-72"></a> <span class='hs-layout'>,</span> <span class='hs-layout'>(</span><span class='hs-varop'>!?</span><span class='hs-layout'>)</span>
<a name="line-73"></a>
<a name="line-74"></a> <span class='hs-comment'>-- * Modifying Markup elements</span>
<a name="line-75"></a> <span class='hs-layout'>,</span> <span class='hs-varid'>contents</span>
<a name="line-76"></a> <span class='hs-layout'>,</span> <span class='hs-varid'>external</span>
<a name="line-77"></a>
<a name="line-78"></a> <span class='hs-comment'>-- * Querying Markup elements</span>
<a name="line-79"></a> <span class='hs-layout'>,</span> <span class='hs-varid'>null</span>
<a name="line-80"></a> <span class='hs-layout'>)</span> <span class='hs-keyword'>where</span>
<a name="line-81"></a>
<a name="line-82"></a><span class='hs-keyword'>import</span> <span class='hs-conid'>Control</span><span class='hs-varop'>.</span><span class='hs-conid'>Applicative</span> <span class='hs-layout'>(</span><span class='hs-conid'>Applicative</span> <span class='hs-layout'>(</span><span class='hs-keyglyph'>..</span><span class='hs-layout'>)</span><span class='hs-layout'>)</span>
<a name="line-83"></a><span class='hs-keyword'>import</span> <span class='hs-keyword'>qualified</span> <span class='hs-conid'>Data</span><span class='hs-varop'>.</span><span class='hs-conid'>List</span> <span class='hs-keyword'>as</span> <span class='hs-conid'>List</span>
<a name="line-84"></a><span class='hs-keyword'>import</span> <span class='hs-conid'>Data</span><span class='hs-varop'>.</span><span class='hs-conid'>Monoid</span> <span class='hs-layout'>(</span><span class='hs-conid'>Monoid</span><span class='hs-layout'>,</span> <span class='hs-varid'>mappend</span><span class='hs-layout'>,</span> <span class='hs-varid'>mconcat</span><span class='hs-layout'>,</span> <span class='hs-varid'>mempty</span><span class='hs-layout'>)</span>
<a name="line-85"></a><span class='hs-keyword'>import</span> <span class='hs-conid'>Prelude</span> <span class='hs-varid'>hiding</span> <span class='hs-layout'>(</span><span class='hs-varid'>null</span><span class='hs-layout'>)</span>
<a name="line-86"></a>
<a name="line-87"></a><span class='hs-keyword'>import</span> <span class='hs-keyword'>qualified</span> <span class='hs-conid'>Data</span><span class='hs-varop'>.</span><span class='hs-conid'>ByteString</span> <span class='hs-keyword'>as</span> <span class='hs-conid'>B</span>
<a name="line-88"></a><span class='hs-keyword'>import</span> <span class='hs-conid'>Data</span><span class='hs-varop'>.</span><span class='hs-conid'>ByteString</span><span class='hs-varop'>.</span><span class='hs-conid'>Char8</span> <span class='hs-layout'>(</span><span class='hs-conid'>ByteString</span><span class='hs-layout'>)</span>
<a name="line-89"></a><span class='hs-keyword'>import</span> <span class='hs-keyword'>qualified</span> <span class='hs-conid'>Data</span><span class='hs-varop'>.</span><span class='hs-conid'>ByteString</span><span class='hs-varop'>.</span><span class='hs-conid'>Lazy</span> <span class='hs-keyword'>as</span> <span class='hs-conid'>BL</span>
<a name="line-90"></a><span class='hs-keyword'>import</span> <span class='hs-conid'>Data</span><span class='hs-varop'>.</span><span class='hs-conid'>Text</span> <span class='hs-layout'>(</span><span class='hs-conid'>Text</span><span class='hs-layout'>)</span>
<a name="line-91"></a><span class='hs-keyword'>import</span> <span class='hs-keyword'>qualified</span> <span class='hs-conid'>Data</span><span class='hs-varop'>.</span><span class='hs-conid'>Text</span> <span class='hs-keyword'>as</span> <span class='hs-conid'>T</span>
<a name="line-92"></a><span class='hs-keyword'>import</span> <span class='hs-keyword'>qualified</span> <span class='hs-conid'>Data</span><span class='hs-varop'>.</span><span class='hs-conid'>Text</span><span class='hs-varop'>.</span><span class='hs-conid'>Encoding</span> <span class='hs-keyword'>as</span> <span class='hs-conid'>T</span>
<a name="line-93"></a><span class='hs-keyword'>import</span> <span class='hs-keyword'>qualified</span> <span class='hs-conid'>Data</span><span class='hs-varop'>.</span><span class='hs-conid'>Text</span><span class='hs-varop'>.</span><span class='hs-conid'>Lazy</span> <span class='hs-keyword'>as</span> <span class='hs-conid'>LT</span>
<a name="line-94"></a><span class='hs-keyword'>import</span> <span class='hs-keyword'>qualified</span> <span class='hs-conid'>Data</span><span class='hs-varop'>.</span><span class='hs-conid'>Text</span><span class='hs-varop'>.</span><span class='hs-conid'>Lazy</span><span class='hs-varop'>.</span><span class='hs-conid'>Builder</span> <span class='hs-keyword'>as</span> <span class='hs-conid'>LTB</span>
<a name="line-95"></a><span class='hs-keyword'>import</span> <span class='hs-conid'>Data</span><span class='hs-varop'>.</span><span class='hs-conid'>Typeable</span> <span class='hs-layout'>(</span><span class='hs-conid'>Typeable</span><span class='hs-layout'>)</span>
<a name="line-96"></a><span class='hs-keyword'>import</span> <span class='hs-conid'>GHC</span><span class='hs-varop'>.</span><span class='hs-conid'>Exts</span> <span class='hs-layout'>(</span><span class='hs-conid'>IsString</span> <span class='hs-layout'>(</span><span class='hs-keyglyph'>..</span><span class='hs-layout'>)</span><span class='hs-layout'>)</span>
<a name="line-97"></a>
<a name="line-98"></a><span class='hs-cpp'>#if MIN_VERSION_base(4,9,0)</span>
<a name="line-99"></a><span class='hs-keyword'>import</span> <span class='hs-conid'>Data</span><span class='hs-varop'>.</span><span class='hs-conid'>Semigroup</span> <span class='hs-layout'>(</span><span class='hs-conid'>Semigroup</span><span class='hs-layout'>)</span>
<a name="line-100"></a><span class='hs-cpp'>#endif</span>
<a name="line-101"></a>
<a name="line-102"></a><a name="StaticString"></a><span class='hs-comment'>-- | A static string that supports efficient output to all possible backends.</span>
<a name="line-103"></a><a name="StaticString"></a><span class='hs-comment'>--</span>
<a name="line-104"></a><a name="StaticString"></a><span class='hs-keyword'>data</span> <span class='hs-conid'>StaticString</span> <span class='hs-keyglyph'>=</span> <span class='hs-conid'>StaticString</span>
<a name="line-105"></a> <span class='hs-layout'>{</span> <span class='hs-varid'>getString</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>String</span> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>String</span> <span class='hs-comment'>-- ^ Appending haskell string</span>
<a name="line-106"></a> <span class='hs-layout'>,</span> <span class='hs-varid'>getUtf8ByteString</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>B</span><span class='hs-varop'>.</span><span class='hs-conid'>ByteString</span> <span class='hs-comment'>-- ^ UTF-8 encoded bytestring</span>
<a name="line-107"></a> <span class='hs-layout'>,</span> <span class='hs-varid'>getText</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>Text</span> <span class='hs-comment'>-- ^ Text value</span>
<a name="line-108"></a> <span class='hs-layout'>}</span>
<a name="line-109"></a>
<a name="line-110"></a><a name="instance%20IsString%20StaticString"></a><span class='hs-comment'>-- 'StaticString's should only be converted from string literals, as far as I</span>
<a name="line-111"></a><a name="instance%20IsString%20StaticString"></a><span class='hs-comment'>-- can see.</span>
<a name="line-112"></a><a name="instance%20IsString%20StaticString"></a><span class='hs-comment'>--</span>
<a name="line-113"></a><a name="instance%20IsString%20StaticString"></a><span class='hs-keyword'>instance</span> <span class='hs-conid'>IsString</span> <span class='hs-conid'>StaticString</span> <span class='hs-keyword'>where</span>
<a name="line-114"></a> <span class='hs-varid'>fromString</span> <span class='hs-varid'>s</span> <span class='hs-keyglyph'>=</span> <span class='hs-keyword'>let</span> <span class='hs-varid'>t</span> <span class='hs-keyglyph'>=</span> <span class='hs-conid'>T</span><span class='hs-varop'>.</span><span class='hs-varid'>pack</span> <span class='hs-varid'>s</span>
<a name="line-115"></a> <span class='hs-keyword'>in</span> <span class='hs-conid'>StaticString</span> <span class='hs-layout'>(</span><span class='hs-varid'>s</span> <span class='hs-varop'>++</span><span class='hs-layout'>)</span> <span class='hs-layout'>(</span><span class='hs-conid'>T</span><span class='hs-varop'>.</span><span class='hs-varid'>encodeUtf8</span> <span class='hs-varid'>t</span><span class='hs-layout'>)</span> <span class='hs-varid'>t</span>
<a name="line-116"></a>
<a name="line-117"></a><a name="ChoiceString"></a><span class='hs-comment'>-- | A string denoting input from different string representations.</span>
<a name="line-118"></a><a name="ChoiceString"></a><span class='hs-comment'>--</span>
<a name="line-119"></a><a name="ChoiceString"></a><span class='hs-keyword'>data</span> <span class='hs-conid'>ChoiceString</span>
<a name="line-120"></a> <span class='hs-comment'>-- | Static data</span>
<a name="line-121"></a> <span class='hs-keyglyph'>=</span> <span class='hs-conid'>Static</span> <span class='hs-comment'>{-# UNPACK #-}</span> <span class='hs-varop'>!</span><span class='hs-conid'>StaticString</span>
<a name="line-122"></a> <span class='hs-comment'>-- | A Haskell String</span>
<a name="line-123"></a> <span class='hs-keyglyph'>|</span> <span class='hs-conid'>String</span> <span class='hs-conid'>String</span>
<a name="line-124"></a> <span class='hs-comment'>-- | A Text value</span>
<a name="line-125"></a> <span class='hs-keyglyph'>|</span> <span class='hs-conid'>Text</span> <span class='hs-conid'>Text</span>
<a name="line-126"></a> <span class='hs-comment'>-- | An encoded bytestring</span>
<a name="line-127"></a> <span class='hs-keyglyph'>|</span> <span class='hs-conid'>ByteString</span> <span class='hs-conid'>B</span><span class='hs-varop'>.</span><span class='hs-conid'>ByteString</span>
<a name="line-128"></a> <span class='hs-comment'>-- | A pre-escaped string</span>
<a name="line-129"></a> <span class='hs-keyglyph'>|</span> <span class='hs-conid'>PreEscaped</span> <span class='hs-conid'>ChoiceString</span>
<a name="line-130"></a> <span class='hs-comment'>-- | External data in style/script tags, should be checked for validity</span>
<a name="line-131"></a> <span class='hs-keyglyph'>|</span> <span class='hs-conid'>External</span> <span class='hs-conid'>ChoiceString</span>
<a name="line-132"></a> <span class='hs-comment'>-- | Concatenation</span>
<a name="line-133"></a> <span class='hs-keyglyph'>|</span> <span class='hs-conid'>AppendChoiceString</span> <span class='hs-conid'>ChoiceString</span> <span class='hs-conid'>ChoiceString</span>
<a name="line-134"></a> <span class='hs-comment'>-- | Empty string</span>
<a name="line-135"></a> <span class='hs-keyglyph'>|</span> <span class='hs-conid'>EmptyChoiceString</span>
<a name="line-136"></a>
<a name="line-137"></a><a name="instance%20Monoid%20ChoiceString"></a><span class='hs-keyword'>instance</span> <span class='hs-conid'>Monoid</span> <span class='hs-conid'>ChoiceString</span> <span class='hs-keyword'>where</span>
<a name="line-138"></a> <span class='hs-varid'>mempty</span> <span class='hs-keyglyph'>=</span> <span class='hs-conid'>EmptyChoiceString</span>
<a name="line-139"></a> <span class='hs-comment'>{-# INLINE mempty #-}</span>
<a name="line-140"></a> <span class='hs-varid'>mappend</span> <span class='hs-keyglyph'>=</span> <span class='hs-conid'>AppendChoiceString</span>
<a name="line-141"></a> <span class='hs-comment'>{-# INLINE mappend #-}</span>
<a name="line-142"></a>
<a name="line-143"></a><a name="instance%20IsString%20ChoiceString"></a><span class='hs-keyword'>instance</span> <span class='hs-conid'>IsString</span> <span class='hs-conid'>ChoiceString</span> <span class='hs-keyword'>where</span>
<a name="line-144"></a> <span class='hs-varid'>fromString</span> <span class='hs-keyglyph'>=</span> <span class='hs-conid'>String</span>
<a name="line-145"></a> <span class='hs-comment'>{-# INLINE fromString #-}</span>
<a name="line-146"></a>
<a name="line-147"></a><a name="MarkupM"></a><span class='hs-comment'>-- | The core Markup datatype.</span>
<a name="line-148"></a><a name="MarkupM"></a><span class='hs-comment'>--</span>
<a name="line-149"></a><a name="MarkupM"></a><span class='hs-keyword'>data</span> <span class='hs-conid'>MarkupM</span> <span class='hs-varid'>a</span>
<a name="line-150"></a> <span class='hs-comment'>-- | Tag, open tag, end tag, content</span>
<a name="line-151"></a> <span class='hs-keyglyph'>=</span> <span class='hs-conid'>Parent</span> <span class='hs-conid'>StaticString</span> <span class='hs-conid'>StaticString</span> <span class='hs-conid'>StaticString</span> <span class='hs-layout'>(</span><span class='hs-conid'>MarkupM</span> <span class='hs-varid'>a</span><span class='hs-layout'>)</span>
<a name="line-152"></a> <span class='hs-comment'>-- | Custom parent</span>
<a name="line-153"></a> <span class='hs-keyglyph'>|</span> <span class='hs-conid'>CustomParent</span> <span class='hs-conid'>ChoiceString</span> <span class='hs-layout'>(</span><span class='hs-conid'>MarkupM</span> <span class='hs-varid'>a</span><span class='hs-layout'>)</span>
<a name="line-154"></a> <span class='hs-comment'>-- | Tag, open tag, end tag</span>
<a name="line-155"></a> <span class='hs-keyglyph'>|</span> <span class='hs-conid'>Leaf</span> <span class='hs-conid'>StaticString</span> <span class='hs-conid'>StaticString</span> <span class='hs-conid'>StaticString</span> <span class='hs-varid'>a</span>
<a name="line-156"></a> <span class='hs-comment'>-- | Custom leaf</span>
<a name="line-157"></a> <span class='hs-keyglyph'>|</span> <span class='hs-conid'>CustomLeaf</span> <span class='hs-conid'>ChoiceString</span> <span class='hs-conid'>Bool</span> <span class='hs-varid'>a</span>
<a name="line-158"></a> <span class='hs-comment'>-- | HTML content</span>
<a name="line-159"></a> <span class='hs-keyglyph'>|</span> <span class='hs-conid'>Content</span> <span class='hs-conid'>ChoiceString</span> <span class='hs-varid'>a</span>
<a name="line-160"></a> <span class='hs-comment'>-- | HTML comment. Note: you should wrap the 'ChoiceString' in a</span>
<a name="line-161"></a> <span class='hs-comment'>-- 'PreEscaped'.</span>
<a name="line-162"></a> <span class='hs-keyglyph'>|</span> <span class='hs-conid'>Comment</span> <span class='hs-conid'>ChoiceString</span> <span class='hs-varid'>a</span>
<a name="line-163"></a> <span class='hs-comment'>-- | Concatenation of two HTML pieces</span>
<a name="line-164"></a> <span class='hs-keyglyph'>|</span> <span class='hs-keyword'>forall</span> <span class='hs-varid'>b</span><span class='hs-varop'>.</span> <span class='hs-conid'>Append</span> <span class='hs-layout'>(</span><span class='hs-conid'>MarkupM</span> <span class='hs-varid'>b</span><span class='hs-layout'>)</span> <span class='hs-layout'>(</span><span class='hs-conid'>MarkupM</span> <span class='hs-varid'>a</span><span class='hs-layout'>)</span>
<a name="line-165"></a> <span class='hs-comment'>-- | Add an attribute to the inner HTML. Raw key, key, value, HTML to</span>
<a name="line-166"></a> <span class='hs-comment'>-- receive the attribute.</span>
<a name="line-167"></a> <span class='hs-keyglyph'>|</span> <span class='hs-conid'>AddAttribute</span> <span class='hs-conid'>StaticString</span> <span class='hs-conid'>StaticString</span> <span class='hs-conid'>ChoiceString</span> <span class='hs-layout'>(</span><span class='hs-conid'>MarkupM</span> <span class='hs-varid'>a</span><span class='hs-layout'>)</span>
<a name="line-168"></a> <span class='hs-comment'>-- | Add a custom attribute to the inner HTML.</span>
<a name="line-169"></a> <span class='hs-keyglyph'>|</span> <span class='hs-conid'>AddCustomAttribute</span> <span class='hs-conid'>ChoiceString</span> <span class='hs-conid'>ChoiceString</span> <span class='hs-layout'>(</span><span class='hs-conid'>MarkupM</span> <span class='hs-varid'>a</span><span class='hs-layout'>)</span>
<a name="line-170"></a> <span class='hs-comment'>-- | Empty HTML.</span>
<a name="line-171"></a> <span class='hs-keyglyph'>|</span> <span class='hs-conid'>Empty</span> <span class='hs-varid'>a</span>
<a name="line-172"></a> <span class='hs-keyword'>deriving</span> <span class='hs-layout'>(</span><span class='hs-conid'>Typeable</span><span class='hs-layout'>)</span>
<a name="line-173"></a>
<a name="line-174"></a><a name="Markup"></a><span class='hs-comment'>-- | Simplification of the 'MarkupM' datatype.</span>
<a name="line-175"></a><a name="Markup"></a><span class='hs-comment'>--</span>
<a name="line-176"></a><a name="Markup"></a><span class='hs-keyword'>type</span> <span class='hs-conid'>Markup</span> <span class='hs-keyglyph'>=</span> <span class='hs-conid'>MarkupM</span> <span class='hs-conid'>()</span>
<a name="line-177"></a>
<a name="line-178"></a><a name="instance%20Monoid%20(MarkupM%20a)"></a><span class='hs-keyword'>instance</span> <span class='hs-conid'>Monoid</span> <span class='hs-varid'>a</span> <span class='hs-keyglyph'>=></span> <span class='hs-conid'>Monoid</span> <span class='hs-layout'>(</span><span class='hs-conid'>MarkupM</span> <span class='hs-varid'>a</span><span class='hs-layout'>)</span> <span class='hs-keyword'>where</span>
<a name="line-179"></a> <span class='hs-varid'>mempty</span> <span class='hs-keyglyph'>=</span> <span class='hs-conid'>Empty</span> <span class='hs-varid'>mempty</span>
<a name="line-180"></a> <span class='hs-comment'>{-# INLINE mempty #-}</span>
<a name="line-181"></a> <span class='hs-varid'>mappend</span> <span class='hs-varid'>x</span> <span class='hs-varid'>y</span> <span class='hs-keyglyph'>=</span> <span class='hs-conid'>Append</span> <span class='hs-varid'>x</span> <span class='hs-varid'>y</span>
<a name="line-182"></a> <span class='hs-comment'>{-# INLINE mappend #-}</span>
<a name="line-183"></a> <span class='hs-varid'>mconcat</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>foldr</span> <span class='hs-conid'>Append</span> <span class='hs-layout'>(</span><span class='hs-conid'>Empty</span> <span class='hs-varid'>mempty</span><span class='hs-layout'>)</span>
<a name="line-184"></a> <span class='hs-comment'>{-# INLINE mconcat #-}</span>
<a name="line-185"></a>
<a name="line-186"></a><span class='hs-cpp'>#if MIN_VERSION_base(4,9,0)</span>
<a name="line-187"></a><a name="instance%20Semigroup%20(MarkupM%20a)"></a><span class='hs-keyword'>instance</span> <span class='hs-conid'>Monoid</span> <span class='hs-varid'>a</span> <span class='hs-keyglyph'>=></span> <span class='hs-conid'>Semigroup</span> <span class='hs-layout'>(</span><span class='hs-conid'>MarkupM</span> <span class='hs-varid'>a</span><span class='hs-layout'>)</span> <span class='hs-keyword'>where</span>
<a name="line-188"></a><span class='hs-cpp'>#endif</span>
<a name="line-189"></a>
<a name="line-190"></a><a name="instance%20Functor%20MarkupM"></a><span class='hs-keyword'>instance</span> <span class='hs-conid'>Functor</span> <span class='hs-conid'>MarkupM</span> <span class='hs-keyword'>where</span>
<a name="line-191"></a> <span class='hs-varid'>fmap</span> <span class='hs-varid'>f</span> <span class='hs-varid'>x</span> <span class='hs-keyglyph'>=</span>
<a name="line-192"></a> <span class='hs-comment'>-- Instead of traversing through all the nodes, we just store an extra</span>
<a name="line-193"></a> <span class='hs-comment'>-- 'Empty' node with the new result.</span>
<a name="line-194"></a> <span class='hs-conid'>Append</span> <span class='hs-varid'>x</span> <span class='hs-layout'>(</span><span class='hs-conid'>Empty</span> <span class='hs-layout'>(</span><span class='hs-varid'>f</span> <span class='hs-layout'>(</span><span class='hs-varid'>markupValue</span> <span class='hs-varid'>x</span><span class='hs-layout'>)</span><span class='hs-layout'>)</span><span class='hs-layout'>)</span>
<a name="line-195"></a>
<a name="line-196"></a><a name="instance%20Applicative%20MarkupM"></a><span class='hs-keyword'>instance</span> <span class='hs-conid'>Applicative</span> <span class='hs-conid'>MarkupM</span> <span class='hs-keyword'>where</span>
<a name="line-197"></a> <span class='hs-varid'>pure</span> <span class='hs-varid'>x</span> <span class='hs-keyglyph'>=</span> <span class='hs-conid'>Empty</span> <span class='hs-varid'>x</span>
<a name="line-198"></a> <span class='hs-comment'>{-# INLINE pure #-}</span>
<a name="line-199"></a> <span class='hs-layout'>(</span><span class='hs-varop'><*></span><span class='hs-layout'>)</span> <span class='hs-varid'>x</span> <span class='hs-varid'>y</span> <span class='hs-keyglyph'>=</span>
<a name="line-200"></a> <span class='hs-comment'>-- We need to add an extra 'Empty' node to store the result.</span>
<a name="line-201"></a> <span class='hs-conid'>Append</span> <span class='hs-layout'>(</span><span class='hs-conid'>Append</span> <span class='hs-varid'>x</span> <span class='hs-varid'>y</span><span class='hs-layout'>)</span> <span class='hs-layout'>(</span><span class='hs-conid'>Empty</span> <span class='hs-layout'>(</span><span class='hs-varid'>markupValue</span> <span class='hs-varid'>x</span> <span class='hs-layout'>(</span><span class='hs-varid'>markupValue</span> <span class='hs-varid'>y</span><span class='hs-layout'>)</span><span class='hs-layout'>)</span><span class='hs-layout'>)</span>
<a name="line-202"></a> <span class='hs-comment'>{-# INLINE (<*>) #-}</span>
<a name="line-203"></a> <span class='hs-layout'>(</span><span class='hs-varop'>*></span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>=</span> <span class='hs-conid'>Append</span>
<a name="line-204"></a> <span class='hs-comment'>{-# INLINE (*>) #-}</span>
<a name="line-205"></a> <span class='hs-comment'>-- (<*) = Append</span>
<a name="line-206"></a> <span class='hs-comment'>-- {-# INLINE (<*) #-}</span>
<a name="line-207"></a>
<a name="line-208"></a><a name="instance%20Monad%20MarkupM"></a><span class='hs-keyword'>instance</span> <span class='hs-conid'>Monad</span> <span class='hs-conid'>MarkupM</span> <span class='hs-keyword'>where</span>
<a name="line-209"></a> <span class='hs-varid'>return</span> <span class='hs-varid'>x</span> <span class='hs-keyglyph'>=</span> <span class='hs-conid'>Empty</span> <span class='hs-varid'>x</span>
<a name="line-210"></a> <span class='hs-comment'>{-# INLINE return #-}</span>
<a name="line-211"></a> <span class='hs-layout'>(</span><span class='hs-varop'>>></span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>=</span> <span class='hs-conid'>Append</span>
<a name="line-212"></a> <span class='hs-comment'>{-# INLINE (>>) #-}</span>
<a name="line-213"></a> <span class='hs-varid'>h1</span> <span class='hs-varop'>>>=</span> <span class='hs-varid'>f</span> <span class='hs-keyglyph'>=</span> <span class='hs-conid'>Append</span> <span class='hs-varid'>h1</span> <span class='hs-layout'>(</span><span class='hs-varid'>f</span> <span class='hs-layout'>(</span><span class='hs-varid'>markupValue</span> <span class='hs-varid'>h1</span><span class='hs-layout'>)</span><span class='hs-layout'>)</span>
<a name="line-214"></a> <span class='hs-comment'>{-# INLINE (>>=) #-}</span>
<a name="line-215"></a>
<a name="line-216"></a><a name="instance%20IsString%20(MarkupM%20a)"></a><span class='hs-keyword'>instance</span> <span class='hs-layout'>(</span><span class='hs-varid'>a</span> <span class='hs-keyglyph'>~</span> <span class='hs-conid'>()</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>=></span> <span class='hs-conid'>IsString</span> <span class='hs-layout'>(</span><span class='hs-conid'>MarkupM</span> <span class='hs-varid'>a</span><span class='hs-layout'>)</span> <span class='hs-keyword'>where</span>
<a name="line-217"></a> <span class='hs-varid'>fromString</span> <span class='hs-varid'>x</span> <span class='hs-keyglyph'>=</span> <span class='hs-conid'>Content</span> <span class='hs-layout'>(</span><span class='hs-varid'>fromString</span> <span class='hs-varid'>x</span><span class='hs-layout'>)</span> <span class='hs-varid'>mempty</span>
<a name="line-218"></a> <span class='hs-comment'>{-# INLINE fromString #-}</span>
<a name="line-219"></a>
<a name="line-220"></a><a name="markupValue"></a><span class='hs-comment'>-- | Get the value from a 'MarkupM'.</span>
<a name="line-221"></a><span class='hs-comment'>--</span>
<a name="line-222"></a><span class='hs-definition'>markupValue</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>MarkupM</span> <span class='hs-varid'>a</span> <span class='hs-keyglyph'>-></span> <span class='hs-varid'>a</span>
<a name="line-223"></a><span class='hs-definition'>markupValue</span> <span class='hs-varid'>m0</span> <span class='hs-keyglyph'>=</span> <span class='hs-keyword'>case</span> <span class='hs-varid'>m0</span> <span class='hs-keyword'>of</span>
<a name="line-224"></a> <span class='hs-conid'>Parent</span> <span class='hs-keyword'>_</span> <span class='hs-keyword'>_</span> <span class='hs-keyword'>_</span> <span class='hs-varid'>m1</span> <span class='hs-keyglyph'>-></span> <span class='hs-varid'>markupValue</span> <span class='hs-varid'>m1</span>
<a name="line-225"></a> <span class='hs-conid'>CustomParent</span> <span class='hs-keyword'>_</span> <span class='hs-varid'>m1</span> <span class='hs-keyglyph'>-></span> <span class='hs-varid'>markupValue</span> <span class='hs-varid'>m1</span>
<a name="line-226"></a> <span class='hs-conid'>Leaf</span> <span class='hs-keyword'>_</span> <span class='hs-keyword'>_</span> <span class='hs-keyword'>_</span> <span class='hs-varid'>x</span> <span class='hs-keyglyph'>-></span> <span class='hs-varid'>x</span>
<a name="line-227"></a> <span class='hs-conid'>CustomLeaf</span> <span class='hs-keyword'>_</span> <span class='hs-keyword'>_</span> <span class='hs-varid'>x</span> <span class='hs-keyglyph'>-></span> <span class='hs-varid'>x</span>
<a name="line-228"></a> <span class='hs-conid'>Content</span> <span class='hs-keyword'>_</span> <span class='hs-varid'>x</span> <span class='hs-keyglyph'>-></span> <span class='hs-varid'>x</span>
<a name="line-229"></a> <span class='hs-conid'>Comment</span> <span class='hs-keyword'>_</span> <span class='hs-varid'>x</span> <span class='hs-keyglyph'>-></span> <span class='hs-varid'>x</span>
<a name="line-230"></a> <span class='hs-conid'>Append</span> <span class='hs-keyword'>_</span> <span class='hs-varid'>m1</span> <span class='hs-keyglyph'>-></span> <span class='hs-varid'>markupValue</span> <span class='hs-varid'>m1</span>
<a name="line-231"></a> <span class='hs-conid'>AddAttribute</span> <span class='hs-keyword'>_</span> <span class='hs-keyword'>_</span> <span class='hs-keyword'>_</span> <span class='hs-varid'>m1</span> <span class='hs-keyglyph'>-></span> <span class='hs-varid'>markupValue</span> <span class='hs-varid'>m1</span>
<a name="line-232"></a> <span class='hs-conid'>AddCustomAttribute</span> <span class='hs-keyword'>_</span> <span class='hs-keyword'>_</span> <span class='hs-varid'>m1</span> <span class='hs-keyglyph'>-></span> <span class='hs-varid'>markupValue</span> <span class='hs-varid'>m1</span>
<a name="line-233"></a> <span class='hs-conid'>Empty</span> <span class='hs-varid'>x</span> <span class='hs-keyglyph'>-></span> <span class='hs-varid'>x</span>
<a name="line-234"></a>
<a name="line-235"></a><a name="Tag"></a><span class='hs-comment'>-- | Type for an HTML tag. This can be seen as an internal string type used by</span>
<a name="line-236"></a><a name="Tag"></a><span class='hs-comment'>-- BlazeMarkup.</span>
<a name="line-237"></a><a name="Tag"></a><span class='hs-comment'>--</span>
<a name="line-238"></a><a name="Tag"></a><span class='hs-keyword'>newtype</span> <span class='hs-conid'>Tag</span> <span class='hs-keyglyph'>=</span> <span class='hs-conid'>Tag</span> <span class='hs-layout'>{</span> <span class='hs-varid'>unTag</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>StaticString</span> <span class='hs-layout'>}</span>
<a name="line-239"></a> <span class='hs-keyword'>deriving</span> <span class='hs-layout'>(</span><span class='hs-conid'>IsString</span><span class='hs-layout'>)</span>
<a name="line-240"></a>
<a name="line-241"></a><a name="Attribute"></a><span class='hs-comment'>-- | Type for an attribute.</span>
<a name="line-242"></a><a name="Attribute"></a><span class='hs-comment'>--</span>
<a name="line-243"></a><a name="Attribute"></a><span class='hs-keyword'>newtype</span> <span class='hs-conid'>Attribute</span> <span class='hs-keyglyph'>=</span> <span class='hs-conid'>Attribute</span> <span class='hs-layout'>(</span><span class='hs-keyword'>forall</span> <span class='hs-varid'>a</span><span class='hs-varop'>.</span> <span class='hs-conid'>MarkupM</span> <span class='hs-varid'>a</span> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>MarkupM</span> <span class='hs-varid'>a</span><span class='hs-layout'>)</span>
<a name="line-244"></a>
<a name="line-245"></a><a name="instance%20Monoid%20Attribute"></a><span class='hs-keyword'>instance</span> <span class='hs-conid'>Monoid</span> <span class='hs-conid'>Attribute</span> <span class='hs-keyword'>where</span>
<a name="line-246"></a> <span class='hs-varid'>mempty</span> <span class='hs-keyglyph'>=</span> <span class='hs-conid'>Attribute</span> <span class='hs-varid'>id</span>
<a name="line-247"></a> <span class='hs-conid'>Attribute</span> <span class='hs-varid'>f</span> <span class='hs-varop'>`mappend`</span> <span class='hs-conid'>Attribute</span> <span class='hs-varid'>g</span> <span class='hs-keyglyph'>=</span> <span class='hs-conid'>Attribute</span> <span class='hs-layout'>(</span><span class='hs-varid'>g</span> <span class='hs-varop'>.</span> <span class='hs-varid'>f</span><span class='hs-layout'>)</span>
<a name="line-248"></a>
<a name="line-249"></a><a name="AttributeValue"></a><span class='hs-comment'>-- | The type for the value part of an attribute.</span>
<a name="line-250"></a><a name="AttributeValue"></a><span class='hs-comment'>--</span>
<a name="line-251"></a><a name="AttributeValue"></a><span class='hs-keyword'>newtype</span> <span class='hs-conid'>AttributeValue</span> <span class='hs-keyglyph'>=</span> <span class='hs-conid'>AttributeValue</span> <span class='hs-layout'>{</span> <span class='hs-varid'>unAttributeValue</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>ChoiceString</span> <span class='hs-layout'>}</span>
<a name="line-252"></a> <span class='hs-keyword'>deriving</span> <span class='hs-layout'>(</span><span class='hs-conid'>IsString</span><span class='hs-layout'>,</span> <span class='hs-conid'>Monoid</span><span class='hs-layout'>)</span>
<a name="line-253"></a>
<a name="line-254"></a><a name="customParent"></a><span class='hs-comment'>-- | Create a custom parent element</span>
<a name="line-255"></a><span class='hs-definition'>customParent</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>Tag</span> <span class='hs-comment'>-- ^ Element tag</span>
<a name="line-256"></a> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>Markup</span> <span class='hs-comment'>-- ^ Content</span>
<a name="line-257"></a> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>Markup</span> <span class='hs-comment'>-- ^ Resulting markup</span>
<a name="line-258"></a><span class='hs-definition'>customParent</span> <span class='hs-varid'>tag</span> <span class='hs-varid'>cont</span> <span class='hs-keyglyph'>=</span> <span class='hs-conid'>CustomParent</span> <span class='hs-layout'>(</span><span class='hs-conid'>Static</span> <span class='hs-varop'>$</span> <span class='hs-varid'>unTag</span> <span class='hs-varid'>tag</span><span class='hs-layout'>)</span> <span class='hs-varid'>cont</span>
<a name="line-259"></a>
<a name="line-260"></a><a name="customLeaf"></a><span class='hs-comment'>-- | Create a custom leaf element</span>
<a name="line-261"></a><span class='hs-definition'>customLeaf</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>Tag</span> <span class='hs-comment'>-- ^ Element tag</span>
<a name="line-262"></a> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>Bool</span> <span class='hs-comment'>-- ^ Close the leaf?</span>
<a name="line-263"></a> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>Markup</span> <span class='hs-comment'>-- ^ Resulting markup</span>
<a name="line-264"></a><span class='hs-definition'>customLeaf</span> <span class='hs-varid'>tag</span> <span class='hs-varid'>close</span> <span class='hs-keyglyph'>=</span> <span class='hs-conid'>CustomLeaf</span> <span class='hs-layout'>(</span><span class='hs-conid'>Static</span> <span class='hs-varop'>$</span> <span class='hs-varid'>unTag</span> <span class='hs-varid'>tag</span><span class='hs-layout'>)</span> <span class='hs-varid'>close</span> <span class='hs-conid'>()</span>
<a name="line-265"></a>
<a name="line-266"></a><a name="attribute"></a><span class='hs-comment'>-- | Create an HTML attribute that can be applied to an HTML element later using</span>
<a name="line-267"></a><span class='hs-comment'>-- the '!' operator.</span>
<a name="line-268"></a><span class='hs-comment'>--</span>
<a name="line-269"></a><span class='hs-definition'>attribute</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>Tag</span> <span class='hs-comment'>-- ^ Raw key</span>
<a name="line-270"></a> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>Tag</span> <span class='hs-comment'>-- ^ Shared key string for the HTML attribute.</span>
<a name="line-271"></a> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>AttributeValue</span> <span class='hs-comment'>-- ^ Value for the HTML attribute.</span>
<a name="line-272"></a> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>Attribute</span> <span class='hs-comment'>-- ^ Resulting HTML attribute.</span>
<a name="line-273"></a><span class='hs-definition'>attribute</span> <span class='hs-varid'>rawKey</span> <span class='hs-varid'>key</span> <span class='hs-varid'>value</span> <span class='hs-keyglyph'>=</span> <span class='hs-conid'>Attribute</span> <span class='hs-varop'>$</span>
<a name="line-274"></a> <span class='hs-conid'>AddAttribute</span> <span class='hs-layout'>(</span><span class='hs-varid'>unTag</span> <span class='hs-varid'>rawKey</span><span class='hs-layout'>)</span> <span class='hs-layout'>(</span><span class='hs-varid'>unTag</span> <span class='hs-varid'>key</span><span class='hs-layout'>)</span> <span class='hs-layout'>(</span><span class='hs-varid'>unAttributeValue</span> <span class='hs-varid'>value</span><span class='hs-layout'>)</span>
<a name="line-275"></a><span class='hs-comment'>{-# INLINE attribute #-}</span>
<a name="line-276"></a>
<a name="line-277"></a><a name="dataAttribute"></a><span class='hs-comment'>-- | From HTML 5 onwards, the user is able to specify custom data attributes.</span>
<a name="line-278"></a><span class='hs-comment'>--</span>
<a name="line-279"></a><span class='hs-comment'>-- An example:</span>
<a name="line-280"></a><span class='hs-comment'>--</span>
<a name="line-281"></a><span class='hs-comment'>-- > <p data-foo="bar">Hello.</p></span>
<a name="line-282"></a><span class='hs-comment'>--</span>
<a name="line-283"></a><span class='hs-comment'>-- We support this in BlazeMarkup using this function. The above fragment could</span>
<a name="line-284"></a><span class='hs-comment'>-- be described using BlazeMarkup with:</span>
<a name="line-285"></a><span class='hs-comment'>--</span>
<a name="line-286"></a><span class='hs-comment'>-- > p ! dataAttribute "foo" "bar" $ "Hello."</span>
<a name="line-287"></a><span class='hs-comment'>--</span>
<a name="line-288"></a><span class='hs-definition'>dataAttribute</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>Tag</span> <span class='hs-comment'>-- ^ Name of the attribute.</span>
<a name="line-289"></a> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>AttributeValue</span> <span class='hs-comment'>-- ^ Value for the attribute.</span>
<a name="line-290"></a> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>Attribute</span> <span class='hs-comment'>-- ^ Resulting HTML attribute.</span>
<a name="line-291"></a><span class='hs-definition'>dataAttribute</span> <span class='hs-varid'>tag</span> <span class='hs-varid'>value</span> <span class='hs-keyglyph'>=</span> <span class='hs-conid'>Attribute</span> <span class='hs-varop'>$</span> <span class='hs-conid'>AddCustomAttribute</span>
<a name="line-292"></a> <span class='hs-layout'>(</span><span class='hs-conid'>Static</span> <span class='hs-str'>"data-"</span> <span class='hs-varop'>`mappend`</span> <span class='hs-conid'>Static</span> <span class='hs-layout'>(</span><span class='hs-varid'>unTag</span> <span class='hs-varid'>tag</span><span class='hs-layout'>)</span><span class='hs-layout'>)</span>
<a name="line-293"></a> <span class='hs-layout'>(</span><span class='hs-varid'>unAttributeValue</span> <span class='hs-varid'>value</span><span class='hs-layout'>)</span>
<a name="line-294"></a><span class='hs-comment'>{-# INLINE dataAttribute #-}</span>
<a name="line-295"></a>
<a name="line-296"></a><a name="customAttribute"></a><span class='hs-comment'>-- | Create a custom attribute. This is not specified in the HTML spec, but some</span>
<a name="line-297"></a><span class='hs-comment'>-- JavaScript libraries rely on it.</span>
<a name="line-298"></a><span class='hs-comment'>--</span>
<a name="line-299"></a><span class='hs-comment'>-- An example:</span>
<a name="line-300"></a><span class='hs-comment'>--</span>
<a name="line-301"></a><span class='hs-comment'>-- > <select dojoType="select">foo</select></span>
<a name="line-302"></a><span class='hs-comment'>--</span>
<a name="line-303"></a><span class='hs-comment'>-- Can be produced using:</span>
<a name="line-304"></a><span class='hs-comment'>--</span>
<a name="line-305"></a><span class='hs-comment'>-- > select ! customAttribute "dojoType" "select" $ "foo"</span>
<a name="line-306"></a><span class='hs-comment'>--</span>
<a name="line-307"></a><span class='hs-definition'>customAttribute</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>Tag</span> <span class='hs-comment'>-- ^ Name of the attribute</span>
<a name="line-308"></a> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>AttributeValue</span> <span class='hs-comment'>-- ^ Value for the attribute</span>
<a name="line-309"></a> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>Attribute</span> <span class='hs-comment'>-- ^ Resulting HTML attribtue</span>
<a name="line-310"></a><span class='hs-definition'>customAttribute</span> <span class='hs-varid'>tag</span> <span class='hs-varid'>value</span> <span class='hs-keyglyph'>=</span> <span class='hs-conid'>Attribute</span> <span class='hs-varop'>$</span> <span class='hs-conid'>AddCustomAttribute</span>
<a name="line-311"></a> <span class='hs-layout'>(</span><span class='hs-conid'>Static</span> <span class='hs-varop'>$</span> <span class='hs-varid'>unTag</span> <span class='hs-varid'>tag</span><span class='hs-layout'>)</span>
<a name="line-312"></a> <span class='hs-layout'>(</span><span class='hs-varid'>unAttributeValue</span> <span class='hs-varid'>value</span><span class='hs-layout'>)</span>
<a name="line-313"></a><span class='hs-comment'>{-# INLINE customAttribute #-}</span>
<a name="line-314"></a>
<a name="line-315"></a><a name="text"></a><span class='hs-comment'>-- | Render text. Functions like these can be used to supply content in HTML.</span>
<a name="line-316"></a><span class='hs-comment'>--</span>
<a name="line-317"></a><span class='hs-definition'>text</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>Text</span> <span class='hs-comment'>-- ^ Text to render.</span>
<a name="line-318"></a> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>Markup</span> <span class='hs-comment'>-- ^ Resulting HTML fragment.</span>
<a name="line-319"></a><span class='hs-definition'>text</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>content</span> <span class='hs-varop'>.</span> <span class='hs-conid'>Text</span>
<a name="line-320"></a><span class='hs-comment'>{-# INLINE text #-}</span>
<a name="line-321"></a>
<a name="line-322"></a><a name="preEscapedText"></a><span class='hs-comment'>-- | Render text without escaping.</span>
<a name="line-323"></a><span class='hs-comment'>--</span>
<a name="line-324"></a><span class='hs-definition'>preEscapedText</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>Text</span> <span class='hs-comment'>-- ^ Text to insert</span>
<a name="line-325"></a> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>Markup</span> <span class='hs-comment'>-- ^ Resulting HTML fragment</span>
<a name="line-326"></a><span class='hs-definition'>preEscapedText</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>content</span> <span class='hs-varop'>.</span> <span class='hs-conid'>PreEscaped</span> <span class='hs-varop'>.</span> <span class='hs-conid'>Text</span>
<a name="line-327"></a><span class='hs-comment'>{-# INLINE preEscapedText #-}</span>
<a name="line-328"></a>
<a name="line-329"></a><a name="lazyText"></a><span class='hs-comment'>-- | A variant of 'text' for lazy 'LT.Text'.</span>
<a name="line-330"></a><span class='hs-comment'>--</span>
<a name="line-331"></a><span class='hs-definition'>lazyText</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>LT</span><span class='hs-varop'>.</span><span class='hs-conid'>Text</span> <span class='hs-comment'>-- ^ Text to insert</span>
<a name="line-332"></a> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>Markup</span> <span class='hs-comment'>-- ^ Resulting HTML fragment</span>
<a name="line-333"></a><span class='hs-definition'>lazyText</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>mconcat</span> <span class='hs-varop'>.</span> <span class='hs-varid'>map</span> <span class='hs-varid'>text</span> <span class='hs-varop'>.</span> <span class='hs-conid'>LT</span><span class='hs-varop'>.</span><span class='hs-varid'>toChunks</span>
<a name="line-334"></a><span class='hs-comment'>{-# INLINE lazyText #-}</span>
<a name="line-335"></a>
<a name="line-336"></a><a name="preEscapedLazyText"></a><span class='hs-comment'>-- | A variant of 'preEscapedText' for lazy 'LT.Text'</span>
<a name="line-337"></a><span class='hs-comment'>--</span>
<a name="line-338"></a><span class='hs-definition'>preEscapedLazyText</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>LT</span><span class='hs-varop'>.</span><span class='hs-conid'>Text</span> <span class='hs-comment'>-- ^ Text to insert</span>
<a name="line-339"></a> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>Markup</span> <span class='hs-comment'>-- ^ Resulting HTML fragment</span>
<a name="line-340"></a><span class='hs-definition'>preEscapedLazyText</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>mconcat</span> <span class='hs-varop'>.</span> <span class='hs-varid'>map</span> <span class='hs-varid'>preEscapedText</span> <span class='hs-varop'>.</span> <span class='hs-conid'>LT</span><span class='hs-varop'>.</span><span class='hs-varid'>toChunks</span>
<a name="line-341"></a><span class='hs-comment'>{-# INLINE preEscapedLazyText #-}</span>
<a name="line-342"></a>
<a name="line-343"></a><a name="textBuilder"></a><span class='hs-comment'>-- | A variant of 'text' for text 'LTB.Builder'.</span>
<a name="line-344"></a><span class='hs-comment'>--</span>
<a name="line-345"></a><span class='hs-definition'>textBuilder</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>LTB</span><span class='hs-varop'>.</span><span class='hs-conid'>Builder</span> <span class='hs-comment'>-- ^ Text to insert</span>
<a name="line-346"></a> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>Markup</span> <span class='hs-comment'>-- ^ Resulting HTML fragment</span>
<a name="line-347"></a><span class='hs-definition'>textBuilder</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>lazyText</span> <span class='hs-varop'>.</span> <span class='hs-conid'>LTB</span><span class='hs-varop'>.</span><span class='hs-varid'>toLazyText</span>
<a name="line-348"></a><span class='hs-comment'>{-# INLINE textBuilder #-}</span>
<a name="line-349"></a>
<a name="line-350"></a><a name="preEscapedTextBuilder"></a><span class='hs-comment'>-- | A variant of 'preEscapedText' for lazy 'LT.Text'</span>
<a name="line-351"></a><span class='hs-comment'>--</span>
<a name="line-352"></a><span class='hs-definition'>preEscapedTextBuilder</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>LTB</span><span class='hs-varop'>.</span><span class='hs-conid'>Builder</span> <span class='hs-comment'>-- ^ Text to insert</span>
<a name="line-353"></a> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>Markup</span> <span class='hs-comment'>-- ^ Resulting HTML fragment</span>
<a name="line-354"></a><span class='hs-definition'>preEscapedTextBuilder</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>preEscapedLazyText</span> <span class='hs-varop'>.</span> <span class='hs-conid'>LTB</span><span class='hs-varop'>.</span><span class='hs-varid'>toLazyText</span>
<a name="line-355"></a><span class='hs-comment'>{-# INLINE preEscapedTextBuilder #-}</span>
<a name="line-356"></a>
<a name="line-357"></a><a name="content"></a><span class='hs-definition'>content</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>ChoiceString</span> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>Markup</span>
<a name="line-358"></a><span class='hs-definition'>content</span> <span class='hs-varid'>cs</span> <span class='hs-keyglyph'>=</span> <span class='hs-conid'>Content</span> <span class='hs-varid'>cs</span> <span class='hs-conid'>()</span>
<a name="line-359"></a><span class='hs-comment'>{-# INLINE content #-}</span>
<a name="line-360"></a>
<a name="line-361"></a><a name="string"></a><span class='hs-comment'>-- | Create an HTML snippet from a 'String'.</span>
<a name="line-362"></a><span class='hs-comment'>--</span>
<a name="line-363"></a><span class='hs-definition'>string</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>String</span> <span class='hs-comment'>-- ^ String to insert.</span>
<a name="line-364"></a> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>Markup</span> <span class='hs-comment'>-- ^ Resulting HTML fragment.</span>
<a name="line-365"></a><span class='hs-definition'>string</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>content</span> <span class='hs-varop'>.</span> <span class='hs-conid'>String</span>
<a name="line-366"></a><span class='hs-comment'>{-# INLINE string #-}</span>
<a name="line-367"></a>
<a name="line-368"></a><a name="preEscapedString"></a><span class='hs-comment'>-- | Create an HTML snippet from a 'String' without escaping</span>
<a name="line-369"></a><span class='hs-comment'>--</span>
<a name="line-370"></a><span class='hs-definition'>preEscapedString</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>String</span> <span class='hs-comment'>-- ^ String to insert.</span>
<a name="line-371"></a> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>Markup</span> <span class='hs-comment'>-- ^ Resulting HTML fragment.</span>
<a name="line-372"></a><span class='hs-definition'>preEscapedString</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>content</span> <span class='hs-varop'>.</span> <span class='hs-conid'>PreEscaped</span> <span class='hs-varop'>.</span> <span class='hs-conid'>String</span>
<a name="line-373"></a><span class='hs-comment'>{-# INLINE preEscapedString #-}</span>
<a name="line-374"></a>
<a name="line-375"></a><a name="unsafeByteString"></a><span class='hs-comment'>-- | Insert a 'ByteString'. This is an unsafe operation:</span>
<a name="line-376"></a><span class='hs-comment'>--</span>
<a name="line-377"></a><span class='hs-comment'>-- * The 'ByteString' could have the wrong encoding.</span>
<a name="line-378"></a><span class='hs-comment'>--</span>
<a name="line-379"></a><span class='hs-comment'>-- * The 'ByteString' might contain illegal HTML characters (no escaping is</span>
<a name="line-380"></a><span class='hs-comment'>-- done).</span>
<a name="line-381"></a><span class='hs-comment'>--</span>
<a name="line-382"></a><span class='hs-definition'>unsafeByteString</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>ByteString</span> <span class='hs-comment'>-- ^ Value to insert.</span>
<a name="line-383"></a> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>Markup</span> <span class='hs-comment'>-- ^ Resulting HTML fragment.</span>
<a name="line-384"></a><span class='hs-definition'>unsafeByteString</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>content</span> <span class='hs-varop'>.</span> <span class='hs-conid'>ByteString</span>
<a name="line-385"></a><span class='hs-comment'>{-# INLINE unsafeByteString #-}</span>
<a name="line-386"></a>
<a name="line-387"></a><a name="unsafeLazyByteString"></a><span class='hs-comment'>-- | Insert a lazy 'BL.ByteString'. See 'unsafeByteString' for reasons why this</span>
<a name="line-388"></a><span class='hs-comment'>-- is an unsafe operation.</span>
<a name="line-389"></a><span class='hs-comment'>--</span>
<a name="line-390"></a><span class='hs-definition'>unsafeLazyByteString</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>BL</span><span class='hs-varop'>.</span><span class='hs-conid'>ByteString</span> <span class='hs-comment'>-- ^ Value to insert</span>
<a name="line-391"></a> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>Markup</span> <span class='hs-comment'>-- ^ Resulting HTML fragment</span>
<a name="line-392"></a><span class='hs-definition'>unsafeLazyByteString</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>mconcat</span> <span class='hs-varop'>.</span> <span class='hs-varid'>map</span> <span class='hs-varid'>unsafeByteString</span> <span class='hs-varop'>.</span> <span class='hs-conid'>BL</span><span class='hs-varop'>.</span><span class='hs-varid'>toChunks</span>
<a name="line-393"></a><span class='hs-comment'>{-# INLINE unsafeLazyByteString #-}</span>
<a name="line-394"></a>
<a name="line-395"></a><a name="comment"></a><span class='hs-definition'>comment</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>ChoiceString</span> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>Markup</span>
<a name="line-396"></a><span class='hs-definition'>comment</span> <span class='hs-varid'>cs</span> <span class='hs-keyglyph'>=</span> <span class='hs-conid'>Comment</span> <span class='hs-varid'>cs</span> <span class='hs-conid'>()</span>
<a name="line-397"></a><span class='hs-comment'>{-# INLINE comment #-}</span>
<a name="line-398"></a>
<a name="line-399"></a><a name="textComment"></a><span class='hs-comment'>-- | Create a comment from a 'Text' value.</span>
<a name="line-400"></a><span class='hs-comment'>-- The text should not contain @"--"@.</span>
<a name="line-401"></a><span class='hs-comment'>-- This is not checked by the library.</span>
<a name="line-402"></a><span class='hs-definition'>textComment</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>Text</span> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>Markup</span>
<a name="line-403"></a><span class='hs-definition'>textComment</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>comment</span> <span class='hs-varop'>.</span> <span class='hs-conid'>PreEscaped</span> <span class='hs-varop'>.</span> <span class='hs-conid'>Text</span>
<a name="line-404"></a>
<a name="line-405"></a><a name="lazyTextComment"></a><span class='hs-comment'>-- | Create a comment from a 'LT.Text' value.</span>
<a name="line-406"></a><span class='hs-comment'>-- The text should not contain @"--"@.</span>
<a name="line-407"></a><span class='hs-comment'>-- This is not checked by the library.</span>
<a name="line-408"></a><span class='hs-definition'>lazyTextComment</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>LT</span><span class='hs-varop'>.</span><span class='hs-conid'>Text</span> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>Markup</span>
<a name="line-409"></a><span class='hs-definition'>lazyTextComment</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>comment</span> <span class='hs-varop'>.</span> <span class='hs-varid'>mconcat</span> <span class='hs-varop'>.</span> <span class='hs-varid'>map</span> <span class='hs-layout'>(</span><span class='hs-conid'>PreEscaped</span> <span class='hs-varop'>.</span> <span class='hs-conid'>Text</span><span class='hs-layout'>)</span> <span class='hs-varop'>.</span> <span class='hs-conid'>LT</span><span class='hs-varop'>.</span><span class='hs-varid'>toChunks</span>
<a name="line-410"></a>
<a name="line-411"></a><a name="stringComment"></a><span class='hs-comment'>-- | Create a comment from a 'String' value.</span>
<a name="line-412"></a><span class='hs-comment'>-- The text should not contain @"--"@.</span>
<a name="line-413"></a><span class='hs-comment'>-- This is not checked by the library.</span>
<a name="line-414"></a><span class='hs-definition'>stringComment</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>String</span> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>Markup</span>
<a name="line-415"></a><span class='hs-definition'>stringComment</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>comment</span> <span class='hs-varop'>.</span> <span class='hs-conid'>PreEscaped</span> <span class='hs-varop'>.</span> <span class='hs-conid'>String</span>
<a name="line-416"></a>
<a name="line-417"></a><a name="unsafeByteStringComment"></a><span class='hs-comment'>-- | Create a comment from a 'ByteString' value.</span>
<a name="line-418"></a><span class='hs-comment'>-- The text should not contain @"--"@.</span>
<a name="line-419"></a><span class='hs-comment'>-- This is not checked by the library.</span>
<a name="line-420"></a><span class='hs-definition'>unsafeByteStringComment</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>ByteString</span> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>Markup</span>
<a name="line-421"></a><span class='hs-definition'>unsafeByteStringComment</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>comment</span> <span class='hs-varop'>.</span> <span class='hs-conid'>PreEscaped</span> <span class='hs-varop'>.</span> <span class='hs-conid'>ByteString</span>
<a name="line-422"></a>
<a name="line-423"></a><a name="unsafeLazyByteStringComment"></a><span class='hs-comment'>-- | Create a comment from a 'BL.ByteString' value.</span>
<a name="line-424"></a><span class='hs-comment'>-- The text should not contain @"--"@.</span>
<a name="line-425"></a><span class='hs-comment'>-- This is not checked by the library.</span>
<a name="line-426"></a><span class='hs-definition'>unsafeLazyByteStringComment</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>BL</span><span class='hs-varop'>.</span><span class='hs-conid'>ByteString</span> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>Markup</span>
<a name="line-427"></a><span class='hs-definition'>unsafeLazyByteStringComment</span> <span class='hs-keyglyph'>=</span>
<a name="line-428"></a> <span class='hs-varid'>comment</span> <span class='hs-varop'>.</span> <span class='hs-varid'>mconcat</span> <span class='hs-varop'>.</span> <span class='hs-varid'>map</span> <span class='hs-layout'>(</span><span class='hs-conid'>PreEscaped</span> <span class='hs-varop'>.</span> <span class='hs-conid'>ByteString</span><span class='hs-layout'>)</span> <span class='hs-varop'>.</span> <span class='hs-conid'>BL</span><span class='hs-varop'>.</span><span class='hs-varid'>toChunks</span>
<a name="line-429"></a>
<a name="line-430"></a><a name="textTag"></a><span class='hs-comment'>-- | Create a 'Tag' from some 'Text'.</span>
<a name="line-431"></a><span class='hs-comment'>--</span>
<a name="line-432"></a><span class='hs-definition'>textTag</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>Text</span> <span class='hs-comment'>-- ^ Text to create a tag from</span>
<a name="line-433"></a> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>Tag</span> <span class='hs-comment'>-- ^ Resulting tag</span>
<a name="line-434"></a><span class='hs-definition'>textTag</span> <span class='hs-varid'>t</span> <span class='hs-keyglyph'>=</span> <span class='hs-conid'>Tag</span> <span class='hs-varop'>$</span> <span class='hs-conid'>StaticString</span> <span class='hs-layout'>(</span><span class='hs-conid'>T</span><span class='hs-varop'>.</span><span class='hs-varid'>unpack</span> <span class='hs-varid'>t</span> <span class='hs-varop'>++</span><span class='hs-layout'>)</span> <span class='hs-layout'>(</span><span class='hs-conid'>T</span><span class='hs-varop'>.</span><span class='hs-varid'>encodeUtf8</span> <span class='hs-varid'>t</span><span class='hs-layout'>)</span> <span class='hs-varid'>t</span>
<a name="line-435"></a>
<a name="line-436"></a><a name="stringTag"></a><span class='hs-comment'>-- | Create a 'Tag' from a 'String'.</span>
<a name="line-437"></a><span class='hs-comment'>--</span>
<a name="line-438"></a><span class='hs-definition'>stringTag</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>String</span> <span class='hs-comment'>-- ^ String to create a tag from</span>
<a name="line-439"></a> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>Tag</span> <span class='hs-comment'>-- ^ Resulting tag</span>
<a name="line-440"></a><span class='hs-definition'>stringTag</span> <span class='hs-keyglyph'>=</span> <span class='hs-conid'>Tag</span> <span class='hs-varop'>.</span> <span class='hs-varid'>fromString</span>
<a name="line-441"></a>
<a name="line-442"></a><a name="textValue"></a><span class='hs-comment'>-- | Render an attribute value from 'Text'.</span>
<a name="line-443"></a><span class='hs-comment'>--</span>
<a name="line-444"></a><span class='hs-definition'>textValue</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>Text</span> <span class='hs-comment'>-- ^ The actual value.</span>
<a name="line-445"></a> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>AttributeValue</span> <span class='hs-comment'>-- ^ Resulting attribute value.</span>
<a name="line-446"></a><span class='hs-definition'>textValue</span> <span class='hs-keyglyph'>=</span> <span class='hs-conid'>AttributeValue</span> <span class='hs-varop'>.</span> <span class='hs-conid'>Text</span>
<a name="line-447"></a><span class='hs-comment'>{-# INLINE textValue #-}</span>
<a name="line-448"></a>
<a name="line-449"></a><a name="preEscapedTextValue"></a><span class='hs-comment'>-- | Render an attribute value from 'Text' without escaping.</span>
<a name="line-450"></a><span class='hs-comment'>--</span>
<a name="line-451"></a><span class='hs-definition'>preEscapedTextValue</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>Text</span> <span class='hs-comment'>-- ^ The actual value</span>
<a name="line-452"></a> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>AttributeValue</span> <span class='hs-comment'>-- ^ Resulting attribute value</span>
<a name="line-453"></a><span class='hs-definition'>preEscapedTextValue</span> <span class='hs-keyglyph'>=</span> <span class='hs-conid'>AttributeValue</span> <span class='hs-varop'>.</span> <span class='hs-conid'>PreEscaped</span> <span class='hs-varop'>.</span> <span class='hs-conid'>Text</span>
<a name="line-454"></a><span class='hs-comment'>{-# INLINE preEscapedTextValue #-}</span>
<a name="line-455"></a>
<a name="line-456"></a><a name="lazyTextValue"></a><span class='hs-comment'>-- | A variant of 'textValue' for lazy 'LT.Text'</span>
<a name="line-457"></a><span class='hs-comment'>--</span>
<a name="line-458"></a><span class='hs-definition'>lazyTextValue</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>LT</span><span class='hs-varop'>.</span><span class='hs-conid'>Text</span> <span class='hs-comment'>-- ^ The actual value</span>
<a name="line-459"></a> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>AttributeValue</span> <span class='hs-comment'>-- ^ Resulting attribute value</span>
<a name="line-460"></a><span class='hs-definition'>lazyTextValue</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>mconcat</span> <span class='hs-varop'>.</span> <span class='hs-varid'>map</span> <span class='hs-varid'>textValue</span> <span class='hs-varop'>.</span> <span class='hs-conid'>LT</span><span class='hs-varop'>.</span><span class='hs-varid'>toChunks</span>
<a name="line-461"></a><span class='hs-comment'>{-# INLINE lazyTextValue #-}</span>
<a name="line-462"></a>
<a name="line-463"></a><a name="preEscapedLazyTextValue"></a><span class='hs-comment'>-- | A variant of 'preEscapedTextValue' for lazy 'LT.Text'</span>
<a name="line-464"></a><span class='hs-comment'>--</span>
<a name="line-465"></a><span class='hs-definition'>preEscapedLazyTextValue</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>LT</span><span class='hs-varop'>.</span><span class='hs-conid'>Text</span> <span class='hs-comment'>-- ^ The actual value</span>
<a name="line-466"></a> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>AttributeValue</span> <span class='hs-comment'>-- ^ Resulting attribute value</span>
<a name="line-467"></a><span class='hs-definition'>preEscapedLazyTextValue</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>mconcat</span> <span class='hs-varop'>.</span> <span class='hs-varid'>map</span> <span class='hs-varid'>preEscapedTextValue</span> <span class='hs-varop'>.</span> <span class='hs-conid'>LT</span><span class='hs-varop'>.</span><span class='hs-varid'>toChunks</span>
<a name="line-468"></a><span class='hs-comment'>{-# INLINE preEscapedLazyTextValue #-}</span>
<a name="line-469"></a>
<a name="line-470"></a><a name="textBuilderValue"></a><span class='hs-comment'>-- | A variant of 'textValue' for text 'LTB.Builder'</span>
<a name="line-471"></a><span class='hs-comment'>--</span>
<a name="line-472"></a><span class='hs-definition'>textBuilderValue</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>LTB</span><span class='hs-varop'>.</span><span class='hs-conid'>Builder</span> <span class='hs-comment'>-- ^ The actual value</span>
<a name="line-473"></a> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>AttributeValue</span> <span class='hs-comment'>-- ^ Resulting attribute value</span>
<a name="line-474"></a><span class='hs-definition'>textBuilderValue</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>lazyTextValue</span> <span class='hs-varop'>.</span> <span class='hs-conid'>LTB</span><span class='hs-varop'>.</span><span class='hs-varid'>toLazyText</span>
<a name="line-475"></a><span class='hs-comment'>{-# INLINE textBuilderValue #-}</span>
<a name="line-476"></a>
<a name="line-477"></a><a name="preEscapedTextBuilderValue"></a><span class='hs-comment'>-- | A variant of 'preEscapedTextValue' for text 'LTB.Builder'</span>
<a name="line-478"></a><span class='hs-comment'>--</span>
<a name="line-479"></a><span class='hs-definition'>preEscapedTextBuilderValue</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>LTB</span><span class='hs-varop'>.</span><span class='hs-conid'>Builder</span> <span class='hs-comment'>-- ^ The actual value</span>
<a name="line-480"></a> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>AttributeValue</span> <span class='hs-comment'>-- ^ Resulting attribute value</span>
<a name="line-481"></a><span class='hs-definition'>preEscapedTextBuilderValue</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>preEscapedLazyTextValue</span> <span class='hs-varop'>.</span> <span class='hs-conid'>LTB</span><span class='hs-varop'>.</span><span class='hs-varid'>toLazyText</span>
<a name="line-482"></a><span class='hs-comment'>{-# INLINE preEscapedTextBuilderValue #-}</span>
<a name="line-483"></a>
<a name="line-484"></a><a name="stringValue"></a><span class='hs-comment'>-- | Create an attribute value from a 'String'.</span>
<a name="line-485"></a><span class='hs-comment'>--</span>
<a name="line-486"></a><span class='hs-definition'>stringValue</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>String</span> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>AttributeValue</span>
<a name="line-487"></a><span class='hs-definition'>stringValue</span> <span class='hs-keyglyph'>=</span> <span class='hs-conid'>AttributeValue</span> <span class='hs-varop'>.</span> <span class='hs-conid'>String</span>
<a name="line-488"></a><span class='hs-comment'>{-# INLINE stringValue #-}</span>
<a name="line-489"></a>
<a name="line-490"></a><a name="preEscapedStringValue"></a><span class='hs-comment'>-- | Create an attribute value from a 'String' without escaping.</span>
<a name="line-491"></a><span class='hs-comment'>--</span>
<a name="line-492"></a><span class='hs-definition'>preEscapedStringValue</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>String</span> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>AttributeValue</span>
<a name="line-493"></a><span class='hs-definition'>preEscapedStringValue</span> <span class='hs-keyglyph'>=</span> <span class='hs-conid'>AttributeValue</span> <span class='hs-varop'>.</span> <span class='hs-conid'>PreEscaped</span> <span class='hs-varop'>.</span> <span class='hs-conid'>String</span>
<a name="line-494"></a><span class='hs-comment'>{-# INLINE preEscapedStringValue #-}</span>
<a name="line-495"></a>
<a name="line-496"></a><a name="unsafeByteStringValue"></a><span class='hs-comment'>-- | Create an attribute value from a 'ByteString'. See 'unsafeByteString'</span>
<a name="line-497"></a><span class='hs-comment'>-- for reasons why this might not be a good idea.</span>
<a name="line-498"></a><span class='hs-comment'>--</span>
<a name="line-499"></a><span class='hs-definition'>unsafeByteStringValue</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>ByteString</span> <span class='hs-comment'>-- ^ ByteString value</span>
<a name="line-500"></a> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>AttributeValue</span> <span class='hs-comment'>-- ^ Resulting attribute value</span>
<a name="line-501"></a><span class='hs-definition'>unsafeByteStringValue</span> <span class='hs-keyglyph'>=</span> <span class='hs-conid'>AttributeValue</span> <span class='hs-varop'>.</span> <span class='hs-conid'>ByteString</span>
<a name="line-502"></a><span class='hs-comment'>{-# INLINE unsafeByteStringValue #-}</span>
<a name="line-503"></a>
<a name="line-504"></a><a name="unsafeLazyByteStringValue"></a><span class='hs-comment'>-- | Create an attribute value from a lazy 'BL.ByteString'. See</span>
<a name="line-505"></a><span class='hs-comment'>-- 'unsafeByteString' for reasons why this might not be a good idea.</span>
<a name="line-506"></a><span class='hs-comment'>--</span>
<a name="line-507"></a><span class='hs-definition'>unsafeLazyByteStringValue</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>BL</span><span class='hs-varop'>.</span><span class='hs-conid'>ByteString</span> <span class='hs-comment'>-- ^ ByteString value</span>
<a name="line-508"></a> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>AttributeValue</span> <span class='hs-comment'>-- ^ Resulting attribute value</span>
<a name="line-509"></a><span class='hs-definition'>unsafeLazyByteStringValue</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>mconcat</span> <span class='hs-varop'>.</span> <span class='hs-varid'>map</span> <span class='hs-varid'>unsafeByteStringValue</span> <span class='hs-varop'>.</span> <span class='hs-conid'>BL</span><span class='hs-varop'>.</span><span class='hs-varid'>toChunks</span>
<a name="line-510"></a><span class='hs-comment'>{-# INLINE unsafeLazyByteStringValue #-}</span>
<a name="line-511"></a>
<a name="line-512"></a><a name="Attributable"></a><span class='hs-comment'>-- | Used for applying attributes. You should not define your own instances of</span>
<a name="line-513"></a><a name="Attributable"></a><span class='hs-comment'>-- this class.</span>
<a name="line-514"></a><a name="Attributable"></a><span class='hs-keyword'>class</span> <span class='hs-conid'>Attributable</span> <span class='hs-varid'>h</span> <span class='hs-keyword'>where</span>
<a name="line-515"></a> <span class='hs-comment'>-- | Apply an attribute to an element.</span>
<a name="line-516"></a> <span class='hs-comment'>--</span>
<a name="line-517"></a> <span class='hs-comment'>-- Example:</span>
<a name="line-518"></a> <span class='hs-comment'>--</span>
<a name="line-519"></a> <span class='hs-comment'>-- > img ! src "foo.png"</span>
<a name="line-520"></a> <span class='hs-comment'>--</span>
<a name="line-521"></a> <span class='hs-comment'>-- Result:</span>
<a name="line-522"></a> <span class='hs-comment'>--</span>
<a name="line-523"></a> <span class='hs-comment'>-- > <img src="foo.png" /></span>
<a name="line-524"></a> <span class='hs-comment'>--</span>
<a name="line-525"></a> <span class='hs-comment'>-- This can be used on nested elements as well.</span>
<a name="line-526"></a> <span class='hs-comment'>--</span>
<a name="line-527"></a> <span class='hs-comment'>-- Example:</span>
<a name="line-528"></a> <span class='hs-comment'>--</span>
<a name="line-529"></a> <span class='hs-comment'>-- > p ! style "float: right" $ "Hello!"</span>
<a name="line-530"></a> <span class='hs-comment'>--</span>
<a name="line-531"></a> <span class='hs-comment'>-- Result:</span>
<a name="line-532"></a> <span class='hs-comment'>--</span>
<a name="line-533"></a> <span class='hs-comment'>-- > <p style="float: right">Hello!</p></span>
<a name="line-534"></a> <span class='hs-comment'>--</span>
<a name="line-535"></a> <span class='hs-layout'>(</span><span class='hs-varop'>!</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>::</span> <span class='hs-varid'>h</span> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>Attribute</span> <span class='hs-keyglyph'>-></span> <span class='hs-varid'>h</span>
<a name="line-536"></a>
<a name="line-537"></a><a name="instance%20Attributable%20(MarkupM%20a)"></a><span class='hs-keyword'>instance</span> <span class='hs-conid'>Attributable</span> <span class='hs-layout'>(</span><span class='hs-conid'>MarkupM</span> <span class='hs-varid'>a</span><span class='hs-layout'>)</span> <span class='hs-keyword'>where</span>
<a name="line-538"></a> <span class='hs-varid'>h</span> <span class='hs-varop'>!</span> <span class='hs-layout'>(</span><span class='hs-conid'>Attribute</span> <span class='hs-varid'>f</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>f</span> <span class='hs-varid'>h</span>
<a name="line-539"></a> <span class='hs-comment'>{-# INLINE (!) #-}</span>
<a name="line-540"></a>
<a name="line-541"></a><a name="instance%20Attributable%20(MarkupM%20a%20-%3e%20MarkupM%20b)"></a><span class='hs-keyword'>instance</span> <span class='hs-conid'>Attributable</span> <span class='hs-layout'>(</span><span class='hs-conid'>MarkupM</span> <span class='hs-varid'>a</span> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>MarkupM</span> <span class='hs-varid'>b</span><span class='hs-layout'>)</span> <span class='hs-keyword'>where</span>
<a name="line-542"></a> <span class='hs-varid'>h</span> <span class='hs-varop'>!</span> <span class='hs-varid'>f</span> <span class='hs-keyglyph'>=</span> <span class='hs-layout'>(</span><span class='hs-varop'>!</span> <span class='hs-varid'>f</span><span class='hs-layout'>)</span> <span class='hs-varop'>.</span> <span class='hs-varid'>h</span>
<a name="line-543"></a> <span class='hs-comment'>{-# INLINE (!) #-}</span>
<a name="line-544"></a>
<a name="line-545"></a><a name="!?"></a><span class='hs-comment'>-- | Shorthand for setting an attribute depending on a conditional.</span>
<a name="line-546"></a><span class='hs-comment'>--</span>
<a name="line-547"></a><span class='hs-comment'>-- Example:</span>
<a name="line-548"></a><span class='hs-comment'>--</span>
<a name="line-549"></a><span class='hs-comment'>-- > p !? (isBig, A.class "big") $ "Hello"</span>
<a name="line-550"></a><span class='hs-comment'>--</span>
<a name="line-551"></a><span class='hs-comment'>-- Gives the same result as:</span>
<a name="line-552"></a><span class='hs-comment'>--</span>
<a name="line-553"></a><span class='hs-comment'>-- > (if isBig then p ! A.class "big" else p) "Hello"</span>
<a name="line-554"></a><span class='hs-comment'>--</span>
<a name="line-555"></a><span class='hs-layout'>(</span><span class='hs-varop'>!?</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>Attributable</span> <span class='hs-varid'>h</span> <span class='hs-keyglyph'>=></span> <span class='hs-varid'>h</span> <span class='hs-keyglyph'>-></span> <span class='hs-layout'>(</span><span class='hs-conid'>Bool</span><span class='hs-layout'>,</span> <span class='hs-conid'>Attribute</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>-></span> <span class='hs-varid'>h</span>
<a name="line-556"></a><span class='hs-layout'>(</span><span class='hs-varop'>!?</span><span class='hs-layout'>)</span> <span class='hs-varid'>h</span> <span class='hs-layout'>(</span><span class='hs-varid'>c</span><span class='hs-layout'>,</span> <span class='hs-varid'>a</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>=</span> <span class='hs-keyword'>if</span> <span class='hs-varid'>c</span> <span class='hs-keyword'>then</span> <span class='hs-varid'>h</span> <span class='hs-varop'>!</span> <span class='hs-varid'>a</span> <span class='hs-keyword'>else</span> <span class='hs-varid'>h</span>
<a name="line-557"></a>
<a name="line-558"></a><a name="external"></a><span class='hs-comment'>-- | Mark HTML as external data. External data can be:</span>
<a name="line-559"></a><span class='hs-comment'>--</span>
<a name="line-560"></a><span class='hs-comment'>-- * CSS data in a @<style>@ tag;</span>
<a name="line-561"></a><span class='hs-comment'>--</span>
<a name="line-562"></a><span class='hs-comment'>-- * Script data in a @<script>@ tag.</span>
<a name="line-563"></a><span class='hs-comment'>--</span>
<a name="line-564"></a><span class='hs-comment'>-- This function is applied automatically when using the @style@ or @script@</span>
<a name="line-565"></a><span class='hs-comment'>-- combinators.</span>
<a name="line-566"></a><span class='hs-comment'>--</span>
<a name="line-567"></a><span class='hs-definition'>external</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>MarkupM</span> <span class='hs-varid'>a</span> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>MarkupM</span> <span class='hs-varid'>a</span>
<a name="line-568"></a><span class='hs-definition'>external</span> <span class='hs-layout'>(</span><span class='hs-conid'>Content</span> <span class='hs-varid'>x</span> <span class='hs-varid'>a</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>=</span> <span class='hs-conid'>Content</span> <span class='hs-layout'>(</span><span class='hs-conid'>External</span> <span class='hs-varid'>x</span><span class='hs-layout'>)</span> <span class='hs-varid'>a</span>
<a name="line-569"></a><span class='hs-definition'>external</span> <span class='hs-layout'>(</span><span class='hs-conid'>Append</span> <span class='hs-varid'>x</span> <span class='hs-varid'>y</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>=</span> <span class='hs-conid'>Append</span> <span class='hs-layout'>(</span><span class='hs-varid'>external</span> <span class='hs-varid'>x</span><span class='hs-layout'>)</span> <span class='hs-layout'>(</span><span class='hs-varid'>external</span> <span class='hs-varid'>y</span><span class='hs-layout'>)</span>
<a name="line-570"></a><span class='hs-definition'>external</span> <span class='hs-layout'>(</span><span class='hs-conid'>Parent</span> <span class='hs-varid'>x</span> <span class='hs-varid'>y</span> <span class='hs-varid'>z</span> <span class='hs-varid'>i</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>=</span> <span class='hs-conid'>Parent</span> <span class='hs-varid'>x</span> <span class='hs-varid'>y</span> <span class='hs-varid'>z</span> <span class='hs-varop'>$</span> <span class='hs-varid'>external</span> <span class='hs-varid'>i</span>
<a name="line-571"></a><span class='hs-definition'>external</span> <span class='hs-layout'>(</span><span class='hs-conid'>CustomParent</span> <span class='hs-varid'>x</span> <span class='hs-varid'>i</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>=</span> <span class='hs-conid'>CustomParent</span> <span class='hs-varid'>x</span> <span class='hs-varop'>$</span> <span class='hs-varid'>external</span> <span class='hs-varid'>i</span>
<a name="line-572"></a><span class='hs-definition'>external</span> <span class='hs-layout'>(</span><span class='hs-conid'>AddAttribute</span> <span class='hs-varid'>x</span> <span class='hs-varid'>y</span> <span class='hs-varid'>z</span> <span class='hs-varid'>i</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>=</span> <span class='hs-conid'>AddAttribute</span> <span class='hs-varid'>x</span> <span class='hs-varid'>y</span> <span class='hs-varid'>z</span> <span class='hs-varop'>$</span> <span class='hs-varid'>external</span> <span class='hs-varid'>i</span>
<a name="line-573"></a><span class='hs-definition'>external</span> <span class='hs-layout'>(</span><span class='hs-conid'>AddCustomAttribute</span> <span class='hs-varid'>x</span> <span class='hs-varid'>y</span> <span class='hs-varid'>i</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>=</span> <span class='hs-conid'>AddCustomAttribute</span> <span class='hs-varid'>x</span> <span class='hs-varid'>y</span> <span class='hs-varop'>$</span> <span class='hs-varid'>external</span> <span class='hs-varid'>i</span>
<a name="line-574"></a><span class='hs-definition'>external</span> <span class='hs-varid'>x</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>x</span>
<a name="line-575"></a><span class='hs-comment'>{-# INLINE external #-}</span>
<a name="line-576"></a>
<a name="line-577"></a><a name="contents"></a><span class='hs-comment'>-- | Take only the text content of an HTML tree.</span>
<a name="line-578"></a><span class='hs-comment'>--</span>
<a name="line-579"></a><span class='hs-comment'>-- > contents $ do</span>
<a name="line-580"></a><span class='hs-comment'>-- > p ! $ "Hello "</span>
<a name="line-581"></a><span class='hs-comment'>-- > p ! $ "Word!"</span>
<a name="line-582"></a><span class='hs-comment'>--</span>
<a name="line-583"></a><span class='hs-comment'>-- Result:</span>
<a name="line-584"></a><span class='hs-comment'>--</span>
<a name="line-585"></a><span class='hs-comment'>-- > Hello World!</span>
<a name="line-586"></a><span class='hs-comment'>--</span>
<a name="line-587"></a><span class='hs-definition'>contents</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>MarkupM</span> <span class='hs-varid'>a</span> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>MarkupM</span> <span class='hs-varid'>a</span>
<a name="line-588"></a><span class='hs-definition'>contents</span> <span class='hs-layout'>(</span><span class='hs-conid'>Parent</span> <span class='hs-keyword'>_</span> <span class='hs-keyword'>_</span> <span class='hs-keyword'>_</span> <span class='hs-varid'>c</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>contents</span> <span class='hs-varid'>c</span>
<a name="line-589"></a><span class='hs-definition'>contents</span> <span class='hs-layout'>(</span><span class='hs-conid'>CustomParent</span> <span class='hs-keyword'>_</span> <span class='hs-varid'>c</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>contents</span> <span class='hs-varid'>c</span>
<a name="line-590"></a><span class='hs-definition'>contents</span> <span class='hs-layout'>(</span><span class='hs-conid'>Content</span> <span class='hs-varid'>c</span> <span class='hs-varid'>x</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>=</span> <span class='hs-conid'>Content</span> <span class='hs-varid'>c</span> <span class='hs-varid'>x</span>
<a name="line-591"></a><span class='hs-definition'>contents</span> <span class='hs-layout'>(</span><span class='hs-conid'>Append</span> <span class='hs-varid'>c1</span> <span class='hs-varid'>c2</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>=</span> <span class='hs-conid'>Append</span> <span class='hs-layout'>(</span><span class='hs-varid'>contents</span> <span class='hs-varid'>c1</span><span class='hs-layout'>)</span> <span class='hs-layout'>(</span><span class='hs-varid'>contents</span> <span class='hs-varid'>c2</span><span class='hs-layout'>)</span>
<a name="line-592"></a><span class='hs-definition'>contents</span> <span class='hs-layout'>(</span><span class='hs-conid'>AddAttribute</span> <span class='hs-keyword'>_</span> <span class='hs-keyword'>_</span> <span class='hs-keyword'>_</span> <span class='hs-varid'>c</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>contents</span> <span class='hs-varid'>c</span>
<a name="line-593"></a><span class='hs-definition'>contents</span> <span class='hs-layout'>(</span><span class='hs-conid'>AddCustomAttribute</span> <span class='hs-keyword'>_</span> <span class='hs-keyword'>_</span> <span class='hs-varid'>c</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>contents</span> <span class='hs-varid'>c</span>
<a name="line-594"></a><span class='hs-definition'>contents</span> <span class='hs-varid'>m</span> <span class='hs-keyglyph'>=</span> <span class='hs-conid'>Empty</span> <span class='hs-layout'>(</span><span class='hs-varid'>markupValue</span> <span class='hs-varid'>m</span><span class='hs-layout'>)</span>
<a name="line-595"></a>
<a name="line-596"></a><a name="null"></a><span class='hs-comment'>-- | Check if a 'Markup' value is completely empty (renders to the empty</span>
<a name="line-597"></a><span class='hs-comment'>-- string).</span>
<a name="line-598"></a><span class='hs-definition'>null</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>MarkupM</span> <span class='hs-varid'>a</span> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>Bool</span>
<a name="line-599"></a><span class='hs-definition'>null</span> <span class='hs-varid'>markup</span> <span class='hs-keyglyph'>=</span> <span class='hs-keyword'>case</span> <span class='hs-varid'>markup</span> <span class='hs-keyword'>of</span>
<a name="line-600"></a> <span class='hs-conid'>Parent</span> <span class='hs-keyword'>_</span> <span class='hs-keyword'>_</span> <span class='hs-keyword'>_</span> <span class='hs-keyword'>_</span> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>False</span>
<a name="line-601"></a> <span class='hs-conid'>CustomParent</span> <span class='hs-keyword'>_</span> <span class='hs-keyword'>_</span> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>False</span>
<a name="line-602"></a> <span class='hs-conid'>Leaf</span> <span class='hs-keyword'>_</span> <span class='hs-keyword'>_</span> <span class='hs-keyword'>_</span> <span class='hs-keyword'>_</span> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>False</span>
<a name="line-603"></a> <span class='hs-conid'>CustomLeaf</span> <span class='hs-keyword'>_</span> <span class='hs-keyword'>_</span> <span class='hs-keyword'>_</span> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>False</span>
<a name="line-604"></a> <span class='hs-conid'>Content</span> <span class='hs-varid'>c</span> <span class='hs-keyword'>_</span> <span class='hs-keyglyph'>-></span> <span class='hs-varid'>emptyChoiceString</span> <span class='hs-varid'>c</span>
<a name="line-605"></a> <span class='hs-conid'>Comment</span> <span class='hs-varid'>c</span> <span class='hs-keyword'>_</span> <span class='hs-keyglyph'>-></span> <span class='hs-varid'>emptyChoiceString</span> <span class='hs-varid'>c</span>
<a name="line-606"></a> <span class='hs-conid'>Append</span> <span class='hs-varid'>c1</span> <span class='hs-varid'>c2</span> <span class='hs-keyglyph'>-></span> <span class='hs-varid'>null</span> <span class='hs-varid'>c1</span> <span class='hs-varop'>&&</span> <span class='hs-varid'>null</span> <span class='hs-varid'>c2</span>
<a name="line-607"></a> <span class='hs-conid'>AddAttribute</span> <span class='hs-keyword'>_</span> <span class='hs-keyword'>_</span> <span class='hs-keyword'>_</span> <span class='hs-varid'>c</span> <span class='hs-keyglyph'>-></span> <span class='hs-varid'>null</span> <span class='hs-varid'>c</span>
<a name="line-608"></a> <span class='hs-conid'>AddCustomAttribute</span> <span class='hs-keyword'>_</span> <span class='hs-keyword'>_</span> <span class='hs-varid'>c</span> <span class='hs-keyglyph'>-></span> <span class='hs-varid'>null</span> <span class='hs-varid'>c</span>
<a name="line-609"></a> <span class='hs-conid'>Empty</span> <span class='hs-keyword'>_</span> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>True</span>
<a name="line-610"></a> <span class='hs-keyword'>where</span>
<a name="line-611"></a> <span class='hs-varid'>emptyChoiceString</span> <span class='hs-varid'>cs</span> <span class='hs-keyglyph'>=</span> <span class='hs-keyword'>case</span> <span class='hs-varid'>cs</span> <span class='hs-keyword'>of</span>
<a name="line-612"></a> <span class='hs-conid'>Static</span> <span class='hs-varid'>ss</span> <span class='hs-keyglyph'>-></span> <span class='hs-varid'>emptyStaticString</span> <span class='hs-varid'>ss</span>
<a name="line-613"></a> <span class='hs-conid'>String</span> <span class='hs-varid'>s</span> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>List</span><span class='hs-varop'>.</span><span class='hs-varid'>null</span> <span class='hs-varid'>s</span>
<a name="line-614"></a> <span class='hs-conid'>Text</span> <span class='hs-varid'>t</span> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>T</span><span class='hs-varop'>.</span><span class='hs-varid'>null</span> <span class='hs-varid'>t</span>
<a name="line-615"></a> <span class='hs-conid'>ByteString</span> <span class='hs-varid'>bs</span> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>B</span><span class='hs-varop'>.</span><span class='hs-varid'>null</span> <span class='hs-varid'>bs</span>
<a name="line-616"></a> <span class='hs-conid'>PreEscaped</span> <span class='hs-varid'>c</span> <span class='hs-keyglyph'>-></span> <span class='hs-varid'>emptyChoiceString</span> <span class='hs-varid'>c</span>
<a name="line-617"></a> <span class='hs-conid'>External</span> <span class='hs-varid'>c</span> <span class='hs-keyglyph'>-></span> <span class='hs-varid'>emptyChoiceString</span> <span class='hs-varid'>c</span>
<a name="line-618"></a> <span class='hs-conid'>AppendChoiceString</span> <span class='hs-varid'>c1</span> <span class='hs-varid'>c2</span> <span class='hs-keyglyph'>-></span> <span class='hs-varid'>emptyChoiceString</span> <span class='hs-varid'>c1</span> <span class='hs-varop'>&&</span> <span class='hs-varid'>emptyChoiceString</span> <span class='hs-varid'>c2</span>
<a name="line-619"></a> <span class='hs-conid'>EmptyChoiceString</span> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>True</span>
<a name="line-620"></a>
<a name="line-621"></a> <span class='hs-varid'>emptyStaticString</span> <span class='hs-keyglyph'>=</span> <span class='hs-conid'>B</span><span class='hs-varop'>.</span><span class='hs-varid'>null</span> <span class='hs-varop'>.</span> <span class='hs-varid'>getUtf8ByteString</span>
</pre></body>
</html>
|