type-of-html 0.3.0.0 → 0.4.0.0
raw patch · 10 files changed
+446/−483 lines, 10 filesdep +ghc-primPVP ok
version bump matches the API change (PVP)
Dependencies added: ghc-prim
API changes (from Hackage documentation)
- Html: convertByteString :: Convert a => a -> Converted ByteString
- Html: convertString :: Convert a => a -> Converted String
- Html: convertText :: Convert a => a -> Converted Text
- Html: instance Html.Reify.Document (a Html.Type.# b) GHC.Base.String => GHC.Show.Show (a Html.Type.# b)
- Html: instance Html.Reify.Document (a Html.Type.# b) GHC.Base.String => GHC.Show.Show [a Html.Type.# b]
- Html: instance Html.Reify.Document (a Html.Type.:> b) GHC.Base.String => GHC.Show.Show (a Html.Type.:> b)
- Html: instance Html.Reify.Document (a Html.Type.:> b) GHC.Base.String => GHC.Show.Show [a Html.Type.:> b]
- Html: instance Html.Reify.Document (a Html.Type.> b) GHC.Base.String => GHC.Show.Show (a Html.Type.> b)
- Html: instance Html.Reify.Document (a Html.Type.> b) GHC.Base.String => GHC.Show.Show [a Html.Type.> b]
+ Html: convert :: Convert a => a -> Converted Builder
+ Html: instance Html.Reify.Document (a Html.Type.# b) => GHC.Show.Show (a Html.Type.# b)
+ Html: instance Html.Reify.Document (a Html.Type.# b) => GHC.Show.Show [a Html.Type.# b]
+ Html: instance Html.Reify.Document (a Html.Type.:> b) => GHC.Show.Show (a Html.Type.:> b)
+ Html: instance Html.Reify.Document (a Html.Type.:> b) => GHC.Show.Show [a Html.Type.:> b]
+ Html: instance Html.Reify.Document (a Html.Type.> b) => GHC.Show.Show (a Html.Type.> b)
+ Html: instance Html.Reify.Document (a Html.Type.> b) => GHC.Show.Show [a Html.Type.> b]
+ Html: renderBuilder :: forall a. Document a => a -> Builder
+ Html.Attribute: unsafe :: Int -> Addr# -> ByteString
- Html: [WithAttributes] :: (a ?> b) => [Attribute] -> b -> a :> b
+ Html: [WithAttributes] :: (a ?> b) => Attribute -> b -> a :> b
- Html: a_A :: ( 'A ?> a) => [Attribute] -> a -> 'A :> a
+ Html: a_A :: ( 'A ?> a) => Attribute -> a -> 'A :> a
- Html: abbr_A :: ( 'Abbr ?> a) => [Attribute] -> a -> 'Abbr :> a
+ Html: abbr_A :: ( 'Abbr ?> a) => Attribute -> a -> 'Abbr :> a
- Html: acronym_A :: ( 'Acronym ?> a) => [Attribute] -> a -> 'Acronym :> a
+ Html: acronym_A :: ( 'Acronym ?> a) => Attribute -> a -> 'Acronym :> a
- Html: addAttributes :: (a ?> b) => [Attribute] -> (a > b) -> (a :> b)
+ Html: addAttributes :: (a ?> b) => Attribute -> (a > b) -> (a :> b)
- Html: address_A :: ( 'Address ?> a) => [Attribute] -> a -> 'Address :> a
+ Html: address_A :: ( 'Address ?> a) => Attribute -> a -> 'Address :> a
- Html: applet_A :: ( 'Applet ?> a) => [Attribute] -> a -> 'Applet :> a
+ Html: applet_A :: ( 'Applet ?> a) => Attribute -> a -> 'Applet :> a
- Html: area_A :: [Attribute] -> 'Area :> ()
+ Html: area_A :: Attribute -> 'Area :> ()
- Html: article_A :: ( 'Article ?> a) => [Attribute] -> a -> 'Article :> a
+ Html: article_A :: ( 'Article ?> a) => Attribute -> a -> 'Article :> a
- Html: aside_A :: ( 'Aside ?> a) => [Attribute] -> a -> 'Aside :> a
+ Html: aside_A :: ( 'Aside ?> a) => Attribute -> a -> 'Aside :> a
- Html: audio_A :: ( 'Audio ?> a) => [Attribute] -> a -> 'Audio :> a
+ Html: audio_A :: ( 'Audio ?> a) => Attribute -> a -> 'Audio :> a
- Html: b_A :: ( 'B ?> a) => [Attribute] -> a -> 'B :> a
+ Html: b_A :: ( 'B ?> a) => Attribute -> a -> 'B :> a
- Html: base_A :: [Attribute] -> 'Base :> ()
+ Html: base_A :: Attribute -> 'Base :> ()
- Html: basefont_A :: ( 'Basefont ?> a) => [Attribute] -> a -> 'Basefont :> a
+ Html: basefont_A :: ( 'Basefont ?> a) => Attribute -> a -> 'Basefont :> a
- Html: bdi_A :: ( 'Bdi ?> a) => [Attribute] -> a -> 'Bdi :> a
+ Html: bdi_A :: ( 'Bdi ?> a) => Attribute -> a -> 'Bdi :> a
- Html: bdo_A :: ( 'Bdo ?> a) => [Attribute] -> a -> 'Bdo :> a
+ Html: bdo_A :: ( 'Bdo ?> a) => Attribute -> a -> 'Bdo :> a
- Html: bgsound_A :: ( 'Bgsound ?> a) => [Attribute] -> a -> 'Bgsound :> a
+ Html: bgsound_A :: ( 'Bgsound ?> a) => Attribute -> a -> 'Bgsound :> a
- Html: big_A :: ( 'Big ?> a) => [Attribute] -> a -> 'Big :> a
+ Html: big_A :: ( 'Big ?> a) => Attribute -> a -> 'Big :> a
- Html: blink_A :: ( 'Blink ?> a) => [Attribute] -> a -> 'Blink :> a
+ Html: blink_A :: ( 'Blink ?> a) => Attribute -> a -> 'Blink :> a
- Html: blockquote_A :: ( 'Blockquote ?> a) => [Attribute] -> a -> 'Blockquote :> a
+ Html: blockquote_A :: ( 'Blockquote ?> a) => Attribute -> a -> 'Blockquote :> a
- Html: body_A :: ( 'Body ?> a) => [Attribute] -> a -> 'Body :> a
+ Html: body_A :: ( 'Body ?> a) => Attribute -> a -> 'Body :> a
- Html: br_A :: [Attribute] -> 'Br :> ()
+ Html: br_A :: Attribute -> 'Br :> ()
- Html: button_A :: ( 'Button ?> a) => [Attribute] -> a -> 'Button :> a
+ Html: button_A :: ( 'Button ?> a) => Attribute -> a -> 'Button :> a
- Html: canvas_A :: ( 'Canvas ?> a) => [Attribute] -> a -> 'Canvas :> a
+ Html: canvas_A :: ( 'Canvas ?> a) => Attribute -> a -> 'Canvas :> a
- Html: caption_A :: ( 'Caption ?> a) => [Attribute] -> a -> 'Caption :> a
+ Html: caption_A :: ( 'Caption ?> a) => Attribute -> a -> 'Caption :> a
- Html: center_A :: ( 'Center ?> a) => [Attribute] -> a -> 'Center :> a
+ Html: center_A :: ( 'Center ?> a) => Attribute -> a -> 'Center :> a
- Html: cite_A :: ( 'Cite ?> a) => [Attribute] -> a -> 'Cite :> a
+ Html: cite_A :: ( 'Cite ?> a) => Attribute -> a -> 'Cite :> a
- Html: code_A :: ( 'Code ?> a) => [Attribute] -> a -> 'Code :> a
+ Html: code_A :: ( 'Code ?> a) => Attribute -> a -> 'Code :> a
- Html: col_A :: [Attribute] -> 'Col :> ()
+ Html: col_A :: Attribute -> 'Col :> ()
- Html: colgroup_A :: ( 'Colgroup ?> a) => [Attribute] -> a -> 'Colgroup :> a
+ Html: colgroup_A :: ( 'Colgroup ?> a) => Attribute -> a -> 'Colgroup :> a
- Html: command_A :: ( 'Command ?> a) => [Attribute] -> a -> 'Command :> a
+ Html: command_A :: ( 'Command ?> a) => Attribute -> a -> 'Command :> a
- Html: content_A :: ( 'Content ?> a) => [Attribute] -> a -> 'Content :> a
+ Html: content_A :: ( 'Content ?> a) => Attribute -> a -> 'Content :> a
- Html: data_A :: ( 'Data ?> a) => [Attribute] -> a -> 'Data :> a
+ Html: data_A :: ( 'Data ?> a) => Attribute -> a -> 'Data :> a
- Html: datalist_A :: ( 'Datalist ?> a) => [Attribute] -> a -> 'Datalist :> a
+ Html: datalist_A :: ( 'Datalist ?> a) => Attribute -> a -> 'Datalist :> a
- Html: dd_A :: ( 'Dd ?> a) => [Attribute] -> a -> 'Dd :> a
+ Html: dd_A :: ( 'Dd ?> a) => Attribute -> a -> 'Dd :> a
- Html: del_A :: ( 'Del ?> a) => [Attribute] -> a -> 'Del :> a
+ Html: del_A :: ( 'Del ?> a) => Attribute -> a -> 'Del :> a
- Html: details_A :: ( 'Details ?> a) => [Attribute] -> a -> 'Details :> a
+ Html: details_A :: ( 'Details ?> a) => Attribute -> a -> 'Details :> a
- Html: dfn_A :: ( 'Dfn ?> a) => [Attribute] -> a -> 'Dfn :> a
+ Html: dfn_A :: ( 'Dfn ?> a) => Attribute -> a -> 'Dfn :> a
- Html: dialog_A :: ( 'Dialog ?> a) => [Attribute] -> a -> 'Dialog :> a
+ Html: dialog_A :: ( 'Dialog ?> a) => Attribute -> a -> 'Dialog :> a
- Html: dir_A :: ( 'Dir ?> a) => [Attribute] -> a -> 'Dir :> a
+ Html: dir_A :: ( 'Dir ?> a) => Attribute -> a -> 'Dir :> a
- Html: div_A :: ( 'Div ?> a) => [Attribute] -> a -> 'Div :> a
+ Html: div_A :: ( 'Div ?> a) => Attribute -> a -> 'Div :> a
- Html: dl_A :: ( 'Dl ?> a) => [Attribute] -> a -> 'Dl :> a
+ Html: dl_A :: ( 'Dl ?> a) => Attribute -> a -> 'Dl :> a
- Html: dt_A :: ( 'Dt ?> a) => [Attribute] -> a -> 'Dt :> a
+ Html: dt_A :: ( 'Dt ?> a) => Attribute -> a -> 'Dt :> a
- Html: element_A :: ( 'Element ?> a) => [Attribute] -> a -> 'Element :> a
+ Html: element_A :: ( 'Element ?> a) => Attribute -> a -> 'Element :> a
- Html: em_A :: ( 'Em ?> a) => [Attribute] -> a -> 'Em :> a
+ Html: em_A :: ( 'Em ?> a) => Attribute -> a -> 'Em :> a
- Html: embed_A :: [Attribute] -> 'Embed :> ()
+ Html: embed_A :: Attribute -> 'Embed :> ()
- Html: fieldset_A :: ( 'Fieldset ?> a) => [Attribute] -> a -> 'Fieldset :> a
+ Html: fieldset_A :: ( 'Fieldset ?> a) => Attribute -> a -> 'Fieldset :> a
- Html: figcaption_A :: ( 'Figcaption ?> a) => [Attribute] -> a -> 'Figcaption :> a
+ Html: figcaption_A :: ( 'Figcaption ?> a) => Attribute -> a -> 'Figcaption :> a
- Html: figure_A :: ( 'Figure ?> a) => [Attribute] -> a -> 'Figure :> a
+ Html: figure_A :: ( 'Figure ?> a) => Attribute -> a -> 'Figure :> a
- Html: font_A :: ( 'Font ?> a) => [Attribute] -> a -> 'Font :> a
+ Html: font_A :: ( 'Font ?> a) => Attribute -> a -> 'Font :> a
- Html: footer_A :: ( 'Footer ?> a) => [Attribute] -> a -> 'Footer :> a
+ Html: footer_A :: ( 'Footer ?> a) => Attribute -> a -> 'Footer :> a
- Html: form_A :: ( 'Form ?> a) => [Attribute] -> a -> 'Form :> a
+ Html: form_A :: ( 'Form ?> a) => Attribute -> a -> 'Form :> a
- Html: frame_A :: ( 'Frame ?> a) => [Attribute] -> a -> 'Frame :> a
+ Html: frame_A :: ( 'Frame ?> a) => Attribute -> a -> 'Frame :> a
- Html: frameset_A :: ( 'Frameset ?> a) => [Attribute] -> a -> 'Frameset :> a
+ Html: frameset_A :: ( 'Frameset ?> a) => Attribute -> a -> 'Frameset :> a
- Html: h1_A :: ( 'H1 ?> a) => [Attribute] -> a -> 'H1 :> a
+ Html: h1_A :: ( 'H1 ?> a) => Attribute -> a -> 'H1 :> a
- Html: h2_A :: ( 'H2 ?> a) => [Attribute] -> a -> 'H2 :> a
+ Html: h2_A :: ( 'H2 ?> a) => Attribute -> a -> 'H2 :> a
- Html: h3_A :: ( 'H3 ?> a) => [Attribute] -> a -> 'H3 :> a
+ Html: h3_A :: ( 'H3 ?> a) => Attribute -> a -> 'H3 :> a
- Html: h4_A :: ( 'H4 ?> a) => [Attribute] -> a -> 'H4 :> a
+ Html: h4_A :: ( 'H4 ?> a) => Attribute -> a -> 'H4 :> a
- Html: h5_A :: ( 'H5 ?> a) => [Attribute] -> a -> 'H5 :> a
+ Html: h5_A :: ( 'H5 ?> a) => Attribute -> a -> 'H5 :> a
- Html: h6_A :: ( 'H6 ?> a) => [Attribute] -> a -> 'H6 :> a
+ Html: h6_A :: ( 'H6 ?> a) => Attribute -> a -> 'H6 :> a
- Html: head_A :: ( 'Head ?> a) => [Attribute] -> a -> 'Head :> a
+ Html: head_A :: ( 'Head ?> a) => Attribute -> a -> 'Head :> a
- Html: header_A :: ( 'Header ?> a) => [Attribute] -> a -> 'Header :> a
+ Html: header_A :: ( 'Header ?> a) => Attribute -> a -> 'Header :> a
- Html: hgroup_A :: ( 'Hgroup ?> a) => [Attribute] -> a -> 'Hgroup :> a
+ Html: hgroup_A :: ( 'Hgroup ?> a) => Attribute -> a -> 'Hgroup :> a
- Html: hr_A :: [Attribute] -> 'Hr :> ()
+ Html: hr_A :: Attribute -> 'Hr :> ()
- Html: html_A :: ( 'Html ?> a) => [Attribute] -> a -> 'Html :> a
+ Html: html_A :: ( 'Html ?> a) => Attribute -> a -> 'Html :> a
- Html: i_A :: ( 'I ?> a) => [Attribute] -> a -> 'I :> a
+ Html: i_A :: ( 'I ?> a) => Attribute -> a -> 'I :> a
- Html: iframe_A :: [Attribute] -> 'Iframe :> ()
+ Html: iframe_A :: Attribute -> 'Iframe :> ()
- Html: image_A :: ( 'Image ?> a) => [Attribute] -> a -> 'Image :> a
+ Html: image_A :: ( 'Image ?> a) => Attribute -> a -> 'Image :> a
- Html: img_A :: [Attribute] -> 'Img :> ()
+ Html: img_A :: Attribute -> 'Img :> ()
- Html: input_A :: ( 'Input ?> a) => [Attribute] -> a -> 'Input :> a
+ Html: input_A :: ( 'Input ?> a) => Attribute -> a -> 'Input :> a
- Html: ins_A :: ( 'Ins ?> a) => [Attribute] -> a -> 'Ins :> a
+ Html: ins_A :: ( 'Ins ?> a) => Attribute -> a -> 'Ins :> a
- Html: isindex_A :: ( 'Isindex ?> a) => [Attribute] -> a -> 'Isindex :> a
+ Html: isindex_A :: ( 'Isindex ?> a) => Attribute -> a -> 'Isindex :> a
- Html: kbd_A :: ( 'Kbd ?> a) => [Attribute] -> a -> 'Kbd :> a
+ Html: kbd_A :: ( 'Kbd ?> a) => Attribute -> a -> 'Kbd :> a
- Html: keygen_A :: ( 'Keygen ?> a) => [Attribute] -> a -> 'Keygen :> a
+ Html: keygen_A :: ( 'Keygen ?> a) => Attribute -> a -> 'Keygen :> a
- Html: label_A :: ( 'Label ?> a) => [Attribute] -> a -> 'Label :> a
+ Html: label_A :: ( 'Label ?> a) => Attribute -> a -> 'Label :> a
- Html: legend_A :: ( 'Legend ?> a) => [Attribute] -> a -> 'Legend :> a
+ Html: legend_A :: ( 'Legend ?> a) => Attribute -> a -> 'Legend :> a
- Html: li_A :: ( 'Li ?> a) => [Attribute] -> a -> 'Li :> a
+ Html: li_A :: ( 'Li ?> a) => Attribute -> a -> 'Li :> a
- Html: link_A :: [Attribute] -> 'Link :> ()
+ Html: link_A :: Attribute -> 'Link :> ()
- Html: listing_A :: ( 'Listing ?> a) => [Attribute] -> a -> 'Listing :> a
+ Html: listing_A :: ( 'Listing ?> a) => Attribute -> a -> 'Listing :> a
- Html: main_A :: ( 'Main ?> a) => [Attribute] -> a -> 'Main :> a
+ Html: main_A :: ( 'Main ?> a) => Attribute -> a -> 'Main :> a
- Html: map_A :: ( 'Map ?> a) => [Attribute] -> a -> 'Map :> a
+ Html: map_A :: ( 'Map ?> a) => Attribute -> a -> 'Map :> a
- Html: mark_A :: ( 'Mark ?> a) => [Attribute] -> a -> 'Mark :> a
+ Html: mark_A :: ( 'Mark ?> a) => Attribute -> a -> 'Mark :> a
- Html: marquee_A :: ( 'Marquee ?> a) => [Attribute] -> a -> 'Marquee :> a
+ Html: marquee_A :: ( 'Marquee ?> a) => Attribute -> a -> 'Marquee :> a
- Html: math_A :: ( 'Math ?> a) => [Attribute] -> a -> 'Math :> a
+ Html: math_A :: ( 'Math ?> a) => Attribute -> a -> 'Math :> a
- Html: menu_A :: ( 'Menu ?> a) => [Attribute] -> a -> 'Menu :> a
+ Html: menu_A :: ( 'Menu ?> a) => Attribute -> a -> 'Menu :> a
- Html: menuitem_A :: [Attribute] -> 'Menuitem :> ()
+ Html: menuitem_A :: Attribute -> 'Menuitem :> ()
- Html: meta_A :: [Attribute] -> 'Meta :> ()
+ Html: meta_A :: Attribute -> 'Meta :> ()
- Html: meter_A :: ( 'Meter ?> a) => [Attribute] -> a -> 'Meter :> a
+ Html: meter_A :: ( 'Meter ?> a) => Attribute -> a -> 'Meter :> a
- Html: multicol_A :: ( 'Multicol ?> a) => [Attribute] -> a -> 'Multicol :> a
+ Html: multicol_A :: ( 'Multicol ?> a) => Attribute -> a -> 'Multicol :> a
- Html: nav_A :: ( 'Nav ?> a) => [Attribute] -> a -> 'Nav :> a
+ Html: nav_A :: ( 'Nav ?> a) => Attribute -> a -> 'Nav :> a
- Html: nextid_A :: ( 'Nextid ?> a) => [Attribute] -> a -> 'Nextid :> a
+ Html: nextid_A :: ( 'Nextid ?> a) => Attribute -> a -> 'Nextid :> a
- Html: nobr_A :: ( 'Nobr ?> a) => [Attribute] -> a -> 'Nobr :> a
+ Html: nobr_A :: ( 'Nobr ?> a) => Attribute -> a -> 'Nobr :> a
- Html: noembed_A :: ( 'Noembed ?> a) => [Attribute] -> a -> 'Noembed :> a
+ Html: noembed_A :: ( 'Noembed ?> a) => Attribute -> a -> 'Noembed :> a
- Html: noframes_A :: ( 'Noframes ?> a) => [Attribute] -> a -> 'Noframes :> a
+ Html: noframes_A :: ( 'Noframes ?> a) => Attribute -> a -> 'Noframes :> a
- Html: noscript_A :: ( 'Noscript ?> a) => [Attribute] -> a -> 'Noscript :> a
+ Html: noscript_A :: ( 'Noscript ?> a) => Attribute -> a -> 'Noscript :> a
- Html: object_A :: ( 'Object ?> a) => [Attribute] -> a -> 'Object :> a
+ Html: object_A :: ( 'Object ?> a) => Attribute -> a -> 'Object :> a
- Html: ol_A :: ( 'Ol ?> a) => [Attribute] -> a -> 'Ol :> a
+ Html: ol_A :: ( 'Ol ?> a) => Attribute -> a -> 'Ol :> a
- Html: optgroup_A :: ( 'Optgroup ?> a) => [Attribute] -> a -> 'Optgroup :> a
+ Html: optgroup_A :: ( 'Optgroup ?> a) => Attribute -> a -> 'Optgroup :> a
- Html: option_A :: ( 'Option ?> a) => [Attribute] -> a -> 'Option :> a
+ Html: option_A :: ( 'Option ?> a) => Attribute -> a -> 'Option :> a
- Html: output_A :: ( 'Output ?> a) => [Attribute] -> a -> 'Output :> a
+ Html: output_A :: ( 'Output ?> a) => Attribute -> a -> 'Output :> a
- Html: p_A :: ( 'P ?> a) => [Attribute] -> a -> 'P :> a
+ Html: p_A :: ( 'P ?> a) => Attribute -> a -> 'P :> a
- Html: param_A :: [Attribute] -> 'Param :> ()
+ Html: param_A :: Attribute -> 'Param :> ()
- Html: picture_A :: ( 'Picture ?> a) => [Attribute] -> a -> 'Picture :> a
+ Html: picture_A :: ( 'Picture ?> a) => Attribute -> a -> 'Picture :> a
- Html: plaintext_A :: ( 'Plaintext ?> a) => [Attribute] -> a -> 'Plaintext :> a
+ Html: plaintext_A :: ( 'Plaintext ?> a) => Attribute -> a -> 'Plaintext :> a
- Html: pre_A :: ( 'Pre ?> a) => [Attribute] -> a -> 'Pre :> a
+ Html: pre_A :: ( 'Pre ?> a) => Attribute -> a -> 'Pre :> a
- Html: progress_A :: ( 'Progress ?> a) => [Attribute] -> a -> 'Progress :> a
+ Html: progress_A :: ( 'Progress ?> a) => Attribute -> a -> 'Progress :> a
- Html: q_A :: ( 'Q ?> a) => [Attribute] -> a -> 'Q :> a
+ Html: q_A :: ( 'Q ?> a) => Attribute -> a -> 'Q :> a
- Html: renderByteString :: Document a ByteString => a -> ByteString
+ Html: renderByteString :: Document a => a -> ByteString
- Html: renderString :: Document a String => a -> String
+ Html: renderString :: Document a => a -> String
- Html: renderText :: Document a Text => a -> Text
+ Html: renderText :: Document a => a -> Text
- Html: rp_A :: ( 'Rp ?> a) => [Attribute] -> a -> 'Rp :> a
+ Html: rp_A :: ( 'Rp ?> a) => Attribute -> a -> 'Rp :> a
- Html: rt_A :: ( 'Rt ?> a) => [Attribute] -> a -> 'Rt :> a
+ Html: rt_A :: ( 'Rt ?> a) => Attribute -> a -> 'Rt :> a
- Html: rtc_A :: ( 'Rtc ?> a) => [Attribute] -> a -> 'Rtc :> a
+ Html: rtc_A :: ( 'Rtc ?> a) => Attribute -> a -> 'Rtc :> a
- Html: ruby_A :: ( 'Ruby ?> a) => [Attribute] -> a -> 'Ruby :> a
+ Html: ruby_A :: ( 'Ruby ?> a) => Attribute -> a -> 'Ruby :> a
- Html: s_A :: ( 'S ?> a) => [Attribute] -> a -> 'S :> a
+ Html: s_A :: ( 'S ?> a) => Attribute -> a -> 'S :> a
- Html: samp_A :: ( 'Samp ?> a) => [Attribute] -> a -> 'Samp :> a
+ Html: samp_A :: ( 'Samp ?> a) => Attribute -> a -> 'Samp :> a
- Html: script_A :: ( 'Script ?> a) => [Attribute] -> a -> 'Script :> a
+ Html: script_A :: ( 'Script ?> a) => Attribute -> a -> 'Script :> a
- Html: section_A :: ( 'Section ?> a) => [Attribute] -> a -> 'Section :> a
+ Html: section_A :: ( 'Section ?> a) => Attribute -> a -> 'Section :> a
- Html: select_A :: ( 'Select ?> a) => [Attribute] -> a -> 'Select :> a
+ Html: select_A :: ( 'Select ?> a) => Attribute -> a -> 'Select :> a
- Html: shadow_A :: ( 'Shadow ?> a) => [Attribute] -> a -> 'Shadow :> a
+ Html: shadow_A :: ( 'Shadow ?> a) => Attribute -> a -> 'Shadow :> a
- Html: slot_A :: ( 'Slot ?> a) => [Attribute] -> a -> 'Slot :> a
+ Html: slot_A :: ( 'Slot ?> a) => Attribute -> a -> 'Slot :> a
- Html: small_A :: ( 'Small ?> a) => [Attribute] -> a -> 'Small :> a
+ Html: small_A :: ( 'Small ?> a) => Attribute -> a -> 'Small :> a
- Html: source_A :: [Attribute] -> 'Source :> ()
+ Html: source_A :: Attribute -> 'Source :> ()
- Html: spacer_A :: ( 'Spacer ?> a) => [Attribute] -> a -> 'Spacer :> a
+ Html: spacer_A :: ( 'Spacer ?> a) => Attribute -> a -> 'Spacer :> a
- Html: span_A :: ( 'Span ?> a) => [Attribute] -> a -> 'Span :> a
+ Html: span_A :: ( 'Span ?> a) => Attribute -> a -> 'Span :> a
- Html: strike_A :: ( 'Strike ?> a) => [Attribute] -> a -> 'Strike :> a
+ Html: strike_A :: ( 'Strike ?> a) => Attribute -> a -> 'Strike :> a
- Html: strong_A :: ( 'Strong ?> a) => [Attribute] -> a -> 'Strong :> a
+ Html: strong_A :: ( 'Strong ?> a) => Attribute -> a -> 'Strong :> a
- Html: style_A :: ( 'Style ?> a) => [Attribute] -> a -> 'Style :> a
+ Html: style_A :: ( 'Style ?> a) => Attribute -> a -> 'Style :> a
- Html: sub_A :: ( 'Sub ?> a) => [Attribute] -> a -> 'Sub :> a
+ Html: sub_A :: ( 'Sub ?> a) => Attribute -> a -> 'Sub :> a
- Html: summary_A :: ( 'Summary ?> a) => [Attribute] -> a -> 'Summary :> a
+ Html: summary_A :: ( 'Summary ?> a) => Attribute -> a -> 'Summary :> a
- Html: sup_A :: ( 'Sup ?> a) => [Attribute] -> a -> 'Sup :> a
+ Html: sup_A :: ( 'Sup ?> a) => Attribute -> a -> 'Sup :> a
- Html: svg_A :: ( 'Svg ?> a) => [Attribute] -> a -> 'Svg :> a
+ Html: svg_A :: ( 'Svg ?> a) => Attribute -> a -> 'Svg :> a
- Html: table_A :: ( 'Table ?> a) => [Attribute] -> a -> 'Table :> a
+ Html: table_A :: ( 'Table ?> a) => Attribute -> a -> 'Table :> a
- Html: tbody_A :: ( 'Tbody ?> a) => [Attribute] -> a -> 'Tbody :> a
+ Html: tbody_A :: ( 'Tbody ?> a) => Attribute -> a -> 'Tbody :> a
- Html: td_A :: ( 'Td ?> a) => [Attribute] -> a -> 'Td :> a
+ Html: td_A :: ( 'Td ?> a) => Attribute -> a -> 'Td :> a
- Html: template_A :: ( 'Template ?> a) => [Attribute] -> a -> 'Template :> a
+ Html: template_A :: ( 'Template ?> a) => Attribute -> a -> 'Template :> a
- Html: textarea_A :: ( 'Textarea ?> a) => [Attribute] -> a -> 'Textarea :> a
+ Html: textarea_A :: ( 'Textarea ?> a) => Attribute -> a -> 'Textarea :> a
- Html: tfoot_A :: ( 'Tfoot ?> a) => [Attribute] -> a -> 'Tfoot :> a
+ Html: tfoot_A :: ( 'Tfoot ?> a) => Attribute -> a -> 'Tfoot :> a
- Html: th_A :: ( 'Th ?> a) => [Attribute] -> a -> 'Th :> a
+ Html: th_A :: ( 'Th ?> a) => Attribute -> a -> 'Th :> a
- Html: thead_A :: ( 'Thead ?> a) => [Attribute] -> a -> 'Thead :> a
+ Html: thead_A :: ( 'Thead ?> a) => Attribute -> a -> 'Thead :> a
- Html: time_A :: ( 'Time ?> a) => [Attribute] -> a -> 'Time :> a
+ Html: time_A :: ( 'Time ?> a) => Attribute -> a -> 'Time :> a
- Html: title_A :: ( 'Title ?> a) => [Attribute] -> a -> 'Title :> a
+ Html: title_A :: ( 'Title ?> a) => Attribute -> a -> 'Title :> a
- Html: tr_A :: ( 'Tr ?> a) => [Attribute] -> a -> 'Tr :> a
+ Html: tr_A :: ( 'Tr ?> a) => Attribute -> a -> 'Tr :> a
- Html: track_A :: [Attribute] -> 'Track :> ()
+ Html: track_A :: Attribute -> 'Track :> ()
- Html: tt_A :: ( 'Tt ?> a) => [Attribute] -> a -> 'Tt :> a
+ Html: tt_A :: ( 'Tt ?> a) => Attribute -> a -> 'Tt :> a
- Html: u_A :: ( 'U ?> a) => [Attribute] -> a -> 'U :> a
+ Html: u_A :: ( 'U ?> a) => Attribute -> a -> 'U :> a
- Html: ul_A :: ( 'Ul ?> a) => [Attribute] -> a -> 'Ul :> a
+ Html: ul_A :: ( 'Ul ?> a) => Attribute -> a -> 'Ul :> a
- Html: var_A :: ( 'Var ?> a) => [Attribute] -> a -> 'Var :> a
+ Html: var_A :: ( 'Var ?> a) => Attribute -> a -> 'Var :> a
- Html: video_A :: ( 'Video ?> a) => [Attribute] -> a -> 'Video :> a
+ Html: video_A :: ( 'Video ?> a) => Attribute -> a -> 'Video :> a
- Html: wbr_A :: [Attribute] -> 'Wbr :> ()
+ Html: wbr_A :: Attribute -> 'Wbr :> ()
- Html: xmp_A :: ( 'Xmp ?> a) => [Attribute] -> a -> 'Xmp :> a
+ Html: xmp_A :: ( 'Xmp ?> a) => Attribute -> a -> 'Xmp :> a
- Html.Attribute: addAttributes :: (a ?> b) => [Attribute] -> (a > b) -> (a :> b)
+ Html.Attribute: addAttributes :: (a ?> b) => Attribute -> (a > b) -> (a :> b)
Files
- ChangeLog.md +9/−4
- bench/Main.hs +26/−39
- src/Html.hs +7/−6
- src/Html/Attribute.hs +128/−117
- src/Html/Convert.hs +56/−100
- src/Html/Element.hs +146/−146
- src/Html/Reify.hs +39/−46
- src/Html/Type.hs +11/−8
- test/Main.hs +22/−16
- type-of-html.cabal +2/−1
ChangeLog.md view
@@ -1,12 +1,17 @@ # Revision history for type-of-html +## 0.4.0.0 -- 2017-09-09++* new api: attributes are now monoids+* builder based: higher perf+ ## 0.3.0.0 -- 2017-09-05 * Overhaul of api-** Monomorphic render functions-** Remove inefficient builders-** Predifined attributes-** Single polymorphic implementation for all renderers+* Monomorphic render functions+* Remove inefficient builders+* Predifined attributes+* Single polymorphic implementation for all renderers ## 0.2.1.0 -- 2017-08-04
bench/Main.hs view
@@ -13,6 +13,7 @@ import Data.String import Control.Monad import Criterion.Main+import Data.Monoid import Text.Blaze.Html5 ((!)) import Text.Blaze.Html.Renderer.Utf8@@ -24,45 +25,31 @@ main = defaultMain [ bgroup "minimal" [ bench "blaze.utf8" $ nf (renderHtml . blazeMinimal) (fromString "TEST")- , bench "string" $ nf (renderString . minimal) "TEST" , bench "bytestring" $ nf (renderByteString . minimal) "TEST"- , bench "text" $ nf (renderText . minimal) "TEST" ] , bgroup "hello world" [ bench "blaze.utf8" $ nf (renderHtml . blazeHelloWorld) (fromString "TEST")- , bench "string" $ nf (renderString . helloWorld) "TEST" , bench "bytestring" $ nf (renderByteString . helloWorld) "TEST"- , bench "text" $ nf (renderText . helloWorld) "TEST" ] , bgroup "attributes short"- [ bench "blaze.utf8" $ nf (renderHtml . blazeAttrShort) (fromString "TEST")- , bench "string" $ nf (renderString . attrShort) "TEST"- , bench "bytestring" $ nf (renderByteString . attrShort) "TEST"- , bench "text" $ nf (renderText . attrShort) "TEST"+ [ bench "blaze.utf8" $ nf (renderHtml . blazeAttrShort) (fromString "TEST")+ , bench "bytestring" $ nf (renderByteString . attrShort) "TEST" ] , bgroup "attributes long"- [ bench "blaze.utf8" $ nf (renderHtml . blazeAttrLong) (fromString "TEST")- , bench "string" $ nf (renderString . attrLong) "TEST"- , bench "bytestring" $ nf (renderByteString . attrLong) "TEST"- , bench "text" $ nf (renderText . attrLong) "TEST"+ [ bench "blaze.utf8" $ nf (renderHtml . blazeAttrLong) (fromString "TEST")+ , bench "bytestring" $ nf (renderByteString . attrLong) "TEST" ] , bgroup "big page" [ bench "blaze.utf8" $ nf (renderHtml . blazeBigPage) (fromString "TEST")- , bench "string" $ nf (renderString . bigPage) "TEST" , bench "bytestring" $ nf (renderByteString . bigPage) "TEST"- , bench "text" $ nf (renderText . bigPage) "TEST" ] , bgroup "big page with attributes" [ bench "blaze.utf8" $ nf (renderHtml . blazeBigPageA) (fromString "TEST")- , bench "string" $ nf (renderString . bigPageA) "TEST" , bench "bytestring" $ nf (renderByteString . bigPageA) "TEST"- , bench "text" $ nf (renderText . bigPageA) "TEST" ] , bgroup "big table" [ bench "blaze.utf8" $ nf (renderHtml . blazeBigTable) (4,4)- , bench "string" $ nf (renderString . bigTable) (4,4) , bench "bytestring" $ nf (renderByteString . bigTable) (4,4)- , bench "text" $ nf (renderText . bigTable) (4,4) ] ] @@ -196,47 +183,47 @@ ) attrLong x =- i_A [ A.accept_ "a"- , A.acceptcharset_ "b"- , A.accesskey_ "c"- , A.action_ "d"- , A.alt_ "f"- , A.async_ "g"] x+ i_A ( A.accept_ "a"+ <> A.acceptcharset_ "b"+ <> A.accesskey_ "c"+ <> A.action_ "d"+ <> A.alt_ "f"+ <> A.async_ "g") x attrShort x- = i_A [A.accept_ "a"]- . i_A [A.acceptcharset_ "b"]- . i_A [A.accesskey_ "c"]- . i_A [A.action_ "d"]- . i_A [A.alt_ "f"]- $ i_A [A.async_ "g"] x+ = i_A (A.accept_ "a")+ . i_A (A.acceptcharset_ "b")+ . i_A (A.accesskey_ "c")+ . i_A (A.action_ "d")+ . i_A (A.alt_ "f")+ $ i_A (A.async_ "g") x bigPageA x = html_ ( body_- ( h1_A [A.id_ "a"]+ ( h1_A (A.id_ "a") ( img_- # strong_A [A.class_ "b"] (0 :: Int)+ # strong_A (A.class_ "b") (0 :: Int) ) # div_- ( div_A [A.id_ "c"] (1 :: Int)+ ( div_A (A.id_ "c") (1 :: Int) ) # div_- ( form_A [A.class_ "d"]+ ( form_A (A.class_ "d") ( fieldset_- ( div_A [A.id_ "e"]+ ( div_A (A.id_ "e") ( div_- ( label_A [A.class_ "f"] "a"+ ( label_A (A.class_ "f") "a" # select_- ( option_A [A.id_ "g"] "b"+ ( option_A (A.id_ "g") "b" # option_ "c" )- # div_A [A.class_ "h"] "d"+ # div_A (A.class_ "h") "d" ) # i_ x )- # button_A [A.id_ "i"] (i_ "e")+ # button_A (A.id_ "i") (i_ "e") ) ) )
src/Html.hs view
@@ -157,6 +157,7 @@ ( renderString , renderText , renderByteString+ , renderBuilder , type (>)(..) , type (:>)(..) , addAttributes@@ -182,9 +183,9 @@ import Html.Attribute (addAttributes) -- | Orphan show instances to faciliate ghci development.-instance Document (a > b) String => Show (a > b) where show = renderString-instance {-# OVERLAPPING #-} Document (a > b) String => Show [a > b] where show = renderString-instance Document (a:> b) String => Show (a:> b) where show = renderString-instance {-# OVERLAPPING #-} Document (a:> b) String => Show [a:> b] where show = renderString-instance Document (a # b) String => Show (a # b) where show = renderString-instance {-# OVERLAPPING #-} Document (a # b) String => Show [a # b] where show = renderString+instance Document (a > b) => Show (a > b) where show = renderString+instance {-# OVERLAPPING #-} Document (a > b) => Show [a > b] where show = renderString+instance Document (a:> b) => Show (a:> b) where show = renderString+instance {-# OVERLAPPING #-} Document (a:> b) => Show [a:> b] where show = renderString+instance Document (a # b) => Show (a # b) where show = renderString+instance {-# OVERLAPPING #-} Document (a # b) => Show [a # b] where show = renderString
src/Html/Attribute.hs view
@@ -1,476 +1,487 @@ {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TypeOperators #-}+{-# LANGUAGE MagicHash #-} module Html.Attribute where import Html.Convert import Html.Type import Data.Semigroup+import Data.ByteString.Builder+import GHC.Prim (Addr#) +import qualified Data.ByteString.Builder.Internal as U+import qualified Data.ByteString.Internal as U+import qualified Data.ByteString.Unsafe as U++{-# INLINE unsafe #-}+unsafe :: Int -> Addr# -> U.ByteString+unsafe i addr = U.accursedUnutterablePerformIO (U.unsafePackAddressLen i addr)+ {-# INLINE addAttributes #-}-addAttributes :: (a ?> b) => [Attribute] -> (a > b) -> (a :> b)+addAttributes :: (a ?> b) => Attribute -> (a > b) -> (a :> b) addAttributes xs (Child b) = WithAttributes xs b {-# INLINE accept_ #-} accept_ :: Convert a => a -> Attribute-accept_ x = Attribute $ " accept=\"" <> unConv (conv x) <> "\""+accept_ x = Attribute $ U.byteStringCopy (unsafe 9 " accept=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE acceptcharset_ #-} acceptcharset_ :: Convert a => a -> Attribute-acceptcharset_ x = Attribute $ " acceptcharset=\"" <> unConv (conv x) <> "\""+acceptcharset_ x = Attribute $ U.byteStringCopy (unsafe 16 " acceptcharset=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE accesskey_ #-} accesskey_ :: Convert a => a -> Attribute-accesskey_ x = Attribute $ " accesskey=\"" <> unConv (conv x) <> "\""+accesskey_ x = Attribute $ U.byteStringCopy (unsafe 12 " accesskey=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE action_ #-} action_ :: Convert a => a -> Attribute-action_ x = Attribute $ " action=\"" <> unConv (conv x) <> "\""+action_ x = Attribute $ U.byteStringCopy (unsafe 9 " action=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE align_ #-} align_ :: Convert a => a -> Attribute-align_ x = Attribute $ " align=\"" <> unConv (conv x) <> "\""+align_ x = Attribute $ U.byteStringCopy (unsafe 8 " align=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE alt_ #-} alt_ :: Convert a => a -> Attribute-alt_ x = Attribute $ " alt=\"" <> unConv (conv x) <> "\""+alt_ x = Attribute $ U.byteStringCopy (unsafe 6 " alt=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE async_ #-} async_ :: Convert a => a -> Attribute-async_ x = Attribute $ " async=\"" <> unConv (conv x) <> "\""+async_ x = Attribute $ U.byteStringCopy (unsafe 8 " async=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE autocomplete_ #-} autocomplete_ :: Convert a => a -> Attribute-autocomplete_ x = Attribute $ " autocomplete=\"" <> unConv (conv x) <> "\""+autocomplete_ x = Attribute $ U.byteStringCopy (unsafe 15 " autocomplete=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE autofocus_ #-} autofocus_ :: Convert a => a -> Attribute-autofocus_ x = Attribute $ " autofocus=\"" <> unConv (conv x) <> "\""+autofocus_ x = Attribute $ U.byteStringCopy (unsafe 12 " autofocus=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE autoplay_ #-} autoplay_ :: Convert a => a -> Attribute-autoplay_ x = Attribute $ " autoplay=\"" <> unConv (conv x) <> "\""+autoplay_ x = Attribute $ U.byteStringCopy (unsafe 11 " autoplay=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE autosave_ #-} autosave_ :: Convert a => a -> Attribute-autosave_ x = Attribute $ " autosave=\"" <> unConv (conv x) <> "\""+autosave_ x = Attribute $ U.byteStringCopy (unsafe 11 " autosave=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE bgcolor_ #-} bgcolor_ :: Convert a => a -> Attribute-bgcolor_ x = Attribute $ " bgcolor=\"" <> unConv (conv x) <> "\""+bgcolor_ x = Attribute $ U.byteStringCopy (unsafe 10 " bgcolor=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE border_ #-} border_ :: Convert a => a -> Attribute-border_ x = Attribute $ " border=\"" <> unConv (conv x) <> "\""+border_ x = Attribute $ U.byteStringCopy (unsafe 9 " border=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE buffered_ #-} buffered_ :: Convert a => a -> Attribute-buffered_ x = Attribute $ " buffered=\"" <> unConv (conv x) <> "\""+buffered_ x = Attribute $ U.byteStringCopy (unsafe 11 " buffered=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE challenge_ #-} challenge_ :: Convert a => a -> Attribute-challenge_ x = Attribute $ " challenge=\"" <> unConv (conv x) <> "\""+challenge_ x = Attribute $ U.byteStringCopy (unsafe 12 " challenge=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE charset_ #-} charset_ :: Convert a => a -> Attribute-charset_ x = Attribute $ " charset=\"" <> unConv (conv x) <> "\""+charset_ x = Attribute $ U.byteStringCopy (unsafe 10 " charset=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE checked_ #-} checked_ :: Convert a => a -> Attribute-checked_ x = Attribute $ " checked=\"" <> unConv (conv x) <> "\""+checked_ x = Attribute $ U.byteStringCopy (unsafe 10 " checked=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE cite_ #-} cite_ :: Convert a => a -> Attribute-cite_ x = Attribute $ " cite=\"" <> unConv (conv x) <> "\""+cite_ x = Attribute $ U.byteStringCopy (unsafe 7 " cite=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE class_ #-} class_ :: Convert a => a -> Attribute-class_ x = Attribute $ " class=\"" <> unConv (conv x) <> "\""+class_ x = Attribute $ U.byteStringCopy (unsafe 8 " class=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE code_ #-} code_ :: Convert a => a -> Attribute-code_ x = Attribute $ " code=\"" <> unConv (conv x) <> "\""+code_ x = Attribute $ U.byteStringCopy (unsafe 7 " code=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE codebase_ #-} codebase_ :: Convert a => a -> Attribute-codebase_ x = Attribute $ " codebase=\"" <> unConv (conv x) <> "\""+codebase_ x = Attribute $ U.byteStringCopy (unsafe 11 " codebase=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE color_ #-} color_ :: Convert a => a -> Attribute-color_ x = Attribute $ " color=\"" <> unConv (conv x) <> "\""+color_ x = Attribute $ U.byteStringCopy (unsafe 8 " color=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE cols_ #-} cols_ :: Convert a => a -> Attribute-cols_ x = Attribute $ " cols=\"" <> unConv (conv x) <> "\""+cols_ x = Attribute $ U.byteStringCopy (unsafe 7 " cols=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE colspan_ #-} colspan_ :: Convert a => a -> Attribute-colspan_ x = Attribute $ " colspan=\"" <> unConv (conv x) <> "\""+colspan_ x = Attribute $ U.byteStringCopy (unsafe 10 " colspan=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE content_ #-} content_ :: Convert a => a -> Attribute-content_ x = Attribute $ " content=\"" <> unConv (conv x) <> "\""+content_ x = Attribute $ U.byteStringCopy (unsafe 10 " content=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE contenteditable_ #-} contenteditable_ :: Convert a => a -> Attribute-contenteditable_ x = Attribute $ " contenteditable=\"" <> unConv (conv x) <> "\""+contenteditable_ x = Attribute $ U.byteStringCopy (unsafe 18 " contenteditable=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE contextmenu_ #-} contextmenu_ :: Convert a => a -> Attribute-contextmenu_ x = Attribute $ " contextmenu=\"" <> unConv (conv x) <> "\""+contextmenu_ x = Attribute $ U.byteStringCopy (unsafe 14 " contextmenu=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE controls_ #-} controls_ :: Convert a => a -> Attribute-controls_ x = Attribute $ " controls=\"" <> unConv (conv x) <> "\""+controls_ x = Attribute $ U.byteStringCopy (unsafe 11 " controls=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE coords_ #-} coords_ :: Convert a => a -> Attribute-coords_ x = Attribute $ " coords=\"" <> unConv (conv x) <> "\""+coords_ x = Attribute $ U.byteStringCopy (unsafe 9 " coords=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE crossorigin_ #-} crossorigin_ :: Convert a => a -> Attribute-crossorigin_ x = Attribute $ " crossorigin=\"" <> unConv (conv x) <> "\""+crossorigin_ x = Attribute $ U.byteStringCopy (unsafe 14 " crossorigin=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE data_ #-} data_ :: Convert a => a -> Attribute-data_ x = Attribute $ " data=\"" <> unConv (conv x) <> "\""+data_ x = Attribute $ U.byteStringCopy (unsafe 7 " data=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE datetime_ #-} datetime_ :: Convert a => a -> Attribute-datetime_ x = Attribute $ " datetime=\"" <> unConv (conv x) <> "\""+datetime_ x = Attribute $ U.byteStringCopy (unsafe 11 " datetime=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE default_ #-} default_ :: Convert a => a -> Attribute-default_ x = Attribute $ " default=\"" <> unConv (conv x) <> "\""+default_ x = Attribute $ U.byteStringCopy (unsafe 10 " default=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE defer_ #-} defer_ :: Convert a => a -> Attribute-defer_ x = Attribute $ " defer=\"" <> unConv (conv x) <> "\""+defer_ x = Attribute $ U.byteStringCopy (unsafe 8 " defer=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE dir_ #-} dir_ :: Convert a => a -> Attribute-dir_ x = Attribute $ " dir=\"" <> unConv (conv x) <> "\""+dir_ x = Attribute $ U.byteStringCopy (unsafe 6 " dir=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE dirname_ #-} dirname_ :: Convert a => a -> Attribute-dirname_ x = Attribute $ " dirname=\"" <> unConv (conv x) <> "\""+dirname_ x = Attribute $ U.byteStringCopy (unsafe 10 " dirname=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE disabled_ #-} disabled_ :: Convert a => a -> Attribute-disabled_ x = Attribute $ " disabled=\"" <> unConv (conv x) <> "\""+disabled_ x = Attribute $ U.byteStringCopy (unsafe 11 " disabled=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE download_ #-} download_ :: Convert a => a -> Attribute-download_ x = Attribute $ " download=\"" <> unConv (conv x) <> "\""+download_ x = Attribute $ U.byteStringCopy (unsafe 11 " download=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE draggable_ #-} draggable_ :: Convert a => a -> Attribute-draggable_ x = Attribute $ " draggable=\"" <> unConv (conv x) <> "\""+draggable_ x = Attribute $ U.byteStringCopy (unsafe 12 " draggable=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE dropzone_ #-} dropzone_ :: Convert a => a -> Attribute-dropzone_ x = Attribute $ " dropzone=\"" <> unConv (conv x) <> "\""+dropzone_ x = Attribute $ U.byteStringCopy (unsafe 11 " dropzone=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE enctype_ #-} enctype_ :: Convert a => a -> Attribute-enctype_ x = Attribute $ " enctype=\"" <> unConv (conv x) <> "\""+enctype_ x = Attribute $ U.byteStringCopy (unsafe 10 " enctype=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE for_ #-} for_ :: Convert a => a -> Attribute-for_ x = Attribute $ " for=\"" <> unConv (conv x) <> "\""+for_ x = Attribute $ U.byteStringCopy (unsafe 6 " for=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE form_ #-} form_ :: Convert a => a -> Attribute-form_ x = Attribute $ " form=\"" <> unConv (conv x) <> "\""+form_ x = Attribute $ U.byteStringCopy (unsafe 7 " form=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE formaction_ #-} formaction_ :: Convert a => a -> Attribute-formaction_ x = Attribute $ " formaction=\"" <> unConv (conv x) <> "\""+formaction_ x = Attribute $ U.byteStringCopy (unsafe 13 " formaction=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE headers_ #-} headers_ :: Convert a => a -> Attribute-headers_ x = Attribute $ " headers=\"" <> unConv (conv x) <> "\""+headers_ x = Attribute $ U.byteStringCopy (unsafe 10 " headers=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE height_ #-} height_ :: Convert a => a -> Attribute-height_ x = Attribute $ " height=\"" <> unConv (conv x) <> "\""+height_ x = Attribute $ U.byteStringCopy (unsafe 9 " height=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE hidden_ #-} hidden_ :: Convert a => a -> Attribute-hidden_ x = Attribute $ " hidden=\"" <> unConv (conv x) <> "\""+hidden_ x = Attribute $ U.byteStringCopy (unsafe 9 " hidden=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE high_ #-} high_ :: Convert a => a -> Attribute-high_ x = Attribute $ " high=\"" <> unConv (conv x) <> "\""+high_ x = Attribute $ U.byteStringCopy (unsafe 7 " high=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE href_ #-} href_ :: Convert a => a -> Attribute-href_ x = Attribute $ " href=\"" <> unConv (conv x) <> "\""+href_ x = Attribute $ U.byteStringCopy (unsafe 7 " href=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE hreflang_ #-} hreflang_ :: Convert a => a -> Attribute-hreflang_ x = Attribute $ " hreflang=\"" <> unConv (conv x) <> "\""+hreflang_ x = Attribute $ U.byteStringCopy (unsafe 11 " hreflang=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE httpequiv_ #-} httpequiv_ :: Convert a => a -> Attribute-httpequiv_ x = Attribute $ " httpequiv=\"" <> unConv (conv x) <> "\""+httpequiv_ x = Attribute $ U.byteStringCopy (unsafe 12 " httpequiv=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE icon_ #-} icon_ :: Convert a => a -> Attribute-icon_ x = Attribute $ " icon=\"" <> unConv (conv x) <> "\""+icon_ x = Attribute $ U.byteStringCopy (unsafe 7 " icon=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE id_ #-} id_ :: Convert a => a -> Attribute-id_ x = Attribute $ " id=\"" <> unConv (conv x) <> "\""+id_ x = Attribute $ U.byteStringCopy (unsafe 5 " id=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE integrity_ #-} integrity_ :: Convert a => a -> Attribute-integrity_ x = Attribute $ " integrity=\"" <> unConv (conv x) <> "\""+integrity_ x = Attribute $ U.byteStringCopy (unsafe 12 " integrity=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE ismap_ #-} ismap_ :: Convert a => a -> Attribute-ismap_ x = Attribute $ " ismap=\"" <> unConv (conv x) <> "\""+ismap_ x = Attribute $ U.byteStringCopy (unsafe 8 " ismap=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE itemprop_ #-} itemprop_ :: Convert a => a -> Attribute-itemprop_ x = Attribute $ " itemprop=\"" <> unConv (conv x) <> "\""+itemprop_ x = Attribute $ U.byteStringCopy (unsafe 11 " itemprop=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE keytype_ #-} keytype_ :: Convert a => a -> Attribute-keytype_ x = Attribute $ " keytype=\"" <> unConv (conv x) <> "\""+keytype_ x = Attribute $ U.byteStringCopy (unsafe 10 " keytype=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE kind_ #-} kind_ :: Convert a => a -> Attribute-kind_ x = Attribute $ " kind=\"" <> unConv (conv x) <> "\""+kind_ x = Attribute $ U.byteStringCopy (unsafe 7 " kind=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE label_ #-} label_ :: Convert a => a -> Attribute-label_ x = Attribute $ " label=\"" <> unConv (conv x) <> "\""+label_ x = Attribute $ U.byteStringCopy (unsafe 8 " label=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE lang_ #-} lang_ :: Convert a => a -> Attribute-lang_ x = Attribute $ " lang=\"" <> unConv (conv x) <> "\""+lang_ x = Attribute $ U.byteStringCopy (unsafe 7 " lang=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE language_ #-} language_ :: Convert a => a -> Attribute-language_ x = Attribute $ " language=\"" <> unConv (conv x) <> "\""+language_ x = Attribute $ U.byteStringCopy (unsafe 11 " language=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE list_ #-} list_ :: Convert a => a -> Attribute-list_ x = Attribute $ " list=\"" <> unConv (conv x) <> "\""+list_ x = Attribute $ U.byteStringCopy (unsafe 7 " list=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE loop_ #-} loop_ :: Convert a => a -> Attribute-loop_ x = Attribute $ " loop=\"" <> unConv (conv x) <> "\""+loop_ x = Attribute $ U.byteStringCopy (unsafe 7 " loop=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE low_ #-} low_ :: Convert a => a -> Attribute-low_ x = Attribute $ " low=\"" <> unConv (conv x) <> "\""+low_ x = Attribute $ U.byteStringCopy (unsafe 6 " low=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE manifest_ #-} manifest_ :: Convert a => a -> Attribute-manifest_ x = Attribute $ " manifest=\"" <> unConv (conv x) <> "\""+manifest_ x = Attribute $ U.byteStringCopy (unsafe 11 " manifest=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE max_ #-} max_ :: Convert a => a -> Attribute-max_ x = Attribute $ " max=\"" <> unConv (conv x) <> "\""+max_ x = Attribute $ U.byteStringCopy (unsafe 6 " max=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE maxlength_ #-} maxlength_ :: Convert a => a -> Attribute-maxlength_ x = Attribute $ " maxlength=\"" <> unConv (conv x) <> "\""+maxlength_ x = Attribute $ U.byteStringCopy (unsafe 12 " maxlength=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE minlength_ #-} minlength_ :: Convert a => a -> Attribute-minlength_ x = Attribute $ " minlength=\"" <> unConv (conv x) <> "\""+minlength_ x = Attribute $ U.byteStringCopy (unsafe 6 " minlength=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE media_ #-} media_ :: Convert a => a -> Attribute-media_ x = Attribute $ " media=\"" <> unConv (conv x) <> "\""+media_ x = Attribute $ U.byteStringCopy (unsafe 8 " media=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE method_ #-} method_ :: Convert a => a -> Attribute-method_ x = Attribute $ " method=\"" <> unConv (conv x) <> "\""+method_ x = Attribute $ U.byteStringCopy (unsafe 9 " method=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE min_ #-} min_ :: Convert a => a -> Attribute-min_ x = Attribute $ " min=\"" <> unConv (conv x) <> "\""+min_ x = Attribute $ U.byteStringCopy (unsafe 6 " min=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE multiple_ #-} multiple_ :: Convert a => a -> Attribute-multiple_ x = Attribute $ " multiple=\"" <> unConv (conv x) <> "\""+multiple_ x = Attribute $ U.byteStringCopy (unsafe 11 " multiple=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE muted_ #-} muted_ :: Convert a => a -> Attribute-muted_ x = Attribute $ " muted=\"" <> unConv (conv x) <> "\""+muted_ x = Attribute $ U.byteStringCopy (unsafe 8 " muted=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE name_ #-} name_ :: Convert a => a -> Attribute-name_ x = Attribute $ " name=\"" <> unConv (conv x) <> "\""+name_ x = Attribute $ U.byteStringCopy (unsafe 7 " name=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE novalidate_ #-} novalidate_ :: Convert a => a -> Attribute-novalidate_ x = Attribute $ " novalidate=\"" <> unConv (conv x) <> "\""+novalidate_ x = Attribute $ U.byteStringCopy (unsafe 13 " novalidate=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE open_ #-} open_ :: Convert a => a -> Attribute-open_ x = Attribute $ " open=\"" <> unConv (conv x) <> "\""+open_ x = Attribute $ U.byteStringCopy (unsafe 7 " open=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE optimum_ #-} optimum_ :: Convert a => a -> Attribute-optimum_ x = Attribute $ " optimum=\"" <> unConv (conv x) <> "\""+optimum_ x = Attribute $ U.byteStringCopy (unsafe 10 " optimum=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE pattern_ #-} pattern_ :: Convert a => a -> Attribute-pattern_ x = Attribute $ " pattern=\"" <> unConv (conv x) <> "\""+pattern_ x = Attribute $ U.byteStringCopy (unsafe 10 " pattern=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE ping_ #-} ping_ :: Convert a => a -> Attribute-ping_ x = Attribute $ " ping=\"" <> unConv (conv x) <> "\""+ping_ x = Attribute $ U.byteStringCopy (unsafe 7 " ping=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE placeholder_ #-} placeholder_ :: Convert a => a -> Attribute-placeholder_ x = Attribute $ " placeholder=\"" <> unConv (conv x) <> "\""+placeholder_ x = Attribute $ U.byteStringCopy (unsafe 14 " placeholder=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE poster_ #-} poster_ :: Convert a => a -> Attribute-poster_ x = Attribute $ " poster=\"" <> unConv (conv x) <> "\""+poster_ x = Attribute $ U.byteStringCopy (unsafe 9 " poster=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE preload_ #-} preload_ :: Convert a => a -> Attribute-preload_ x = Attribute $ " preload=\"" <> unConv (conv x) <> "\""+preload_ x = Attribute $ U.byteStringCopy (unsafe 10 " preload=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE radiogroup_ #-} radiogroup_ :: Convert a => a -> Attribute-radiogroup_ x = Attribute $ " radiogroup=\"" <> unConv (conv x) <> "\""+radiogroup_ x = Attribute $ U.byteStringCopy (unsafe 13 " radiogroup=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE readonly_ #-} readonly_ :: Convert a => a -> Attribute-readonly_ x = Attribute $ " readonly=\"" <> unConv (conv x) <> "\""+readonly_ x = Attribute $ U.byteStringCopy (unsafe 11 " readonly=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE rel_ #-} rel_ :: Convert a => a -> Attribute-rel_ x = Attribute $ " rel=\"" <> unConv (conv x) <> "\""+rel_ x = Attribute $ U.byteStringCopy (unsafe 6 " rel=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE required_ #-} required_ :: Convert a => a -> Attribute-required_ x = Attribute $ " required=\"" <> unConv (conv x) <> "\""+required_ x = Attribute $ U.byteStringCopy (unsafe 11 " required=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE reversed_ #-} reversed_ :: Convert a => a -> Attribute-reversed_ x = Attribute $ " reversed=\"" <> unConv (conv x) <> "\""+reversed_ x = Attribute $ U.byteStringCopy (unsafe 11 " reversed=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE rows_ #-} rows_ :: Convert a => a -> Attribute-rows_ x = Attribute $ " rows=\"" <> unConv (conv x) <> "\""+rows_ x = Attribute $ U.byteStringCopy (unsafe 7 " rows=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE rowspan_ #-} rowspan_ :: Convert a => a -> Attribute-rowspan_ x = Attribute $ " rowspan=\"" <> unConv (conv x) <> "\""+rowspan_ x = Attribute $ U.byteStringCopy (unsafe 10 " rowspan=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE sandbox_ #-} sandbox_ :: Convert a => a -> Attribute-sandbox_ x = Attribute $ " sandbox=\"" <> unConv (conv x) <> "\""+sandbox_ x = Attribute $ U.byteStringCopy (unsafe 10 " sandbox=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE scope_ #-} scope_ :: Convert a => a -> Attribute-scope_ x = Attribute $ " scope=\"" <> unConv (conv x) <> "\""+scope_ x = Attribute $ U.byteStringCopy (unsafe 8 " scope=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE scoped_ #-} scoped_ :: Convert a => a -> Attribute-scoped_ x = Attribute $ " scoped=\"" <> unConv (conv x) <> "\""+scoped_ x = Attribute $ U.byteStringCopy (unsafe 9 " scoped=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE seamless_ #-} seamless_ :: Convert a => a -> Attribute-seamless_ x = Attribute $ " seamless=\"" <> unConv (conv x) <> "\""+seamless_ x = Attribute $ U.byteStringCopy (unsafe 11 " seamless=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE selected_ #-} selected_ :: Convert a => a -> Attribute-selected_ x = Attribute $ " selected=\"" <> unConv (conv x) <> "\""+selected_ x = Attribute $ U.byteStringCopy (unsafe 11 " selected=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE shape_ #-} shape_ :: Convert a => a -> Attribute-shape_ x = Attribute $ " shape=\"" <> unConv (conv x) <> "\""+shape_ x = Attribute $ U.byteStringCopy (unsafe 8 " shape=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE size_ #-} size_ :: Convert a => a -> Attribute-size_ x = Attribute $ " size=\"" <> unConv (conv x) <> "\""+size_ x = Attribute $ U.byteStringCopy (unsafe 7 " size=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE sizes_ #-} sizes_ :: Convert a => a -> Attribute-sizes_ x = Attribute $ " sizes=\"" <> unConv (conv x) <> "\""+sizes_ x = Attribute $ U.byteStringCopy (unsafe 8 " sizes=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE slot_ #-} slot_ :: Convert a => a -> Attribute-slot_ x = Attribute $ " slot=\"" <> unConv (conv x) <> "\""+slot_ x = Attribute $ U.byteStringCopy (unsafe 7 " slot=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE span_ #-} span_ :: Convert a => a -> Attribute-span_ x = Attribute $ " span=\"" <> unConv (conv x) <> "\""+span_ x = Attribute $ U.byteStringCopy (unsafe 7 " span=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE spellcheck_ #-} spellcheck_ :: Convert a => a -> Attribute-spellcheck_ x = Attribute $ " spellcheck=\"" <> unConv (conv x) <> "\""+spellcheck_ x = Attribute $ U.byteStringCopy (unsafe 13 " spellcheck=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE src_ #-} src_ :: Convert a => a -> Attribute-src_ x = Attribute $ " src=\"" <> unConv (conv x) <> "\""+src_ x = Attribute $ U.byteStringCopy (unsafe 6 " src=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE srcdoc_ #-} srcdoc_ :: Convert a => a -> Attribute-srcdoc_ x = Attribute $ " srcdoc=\"" <> unConv (conv x) <> "\""+srcdoc_ x = Attribute $ U.byteStringCopy (unsafe 9 " srcdoc=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE srclang_ #-} srclang_ :: Convert a => a -> Attribute-srclang_ x = Attribute $ " srclang=\"" <> unConv (conv x) <> "\""+srclang_ x = Attribute $ U.byteStringCopy (unsafe 10 " srclang=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE srcset_ #-} srcset_ :: Convert a => a -> Attribute-srcset_ x = Attribute $ " srcset=\"" <> unConv (conv x) <> "\""+srcset_ x = Attribute $ U.byteStringCopy (unsafe 9 " srcset=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE start_ #-} start_ :: Convert a => a -> Attribute-start_ x = Attribute $ " start=\"" <> unConv (conv x) <> "\""+start_ x = Attribute $ U.byteStringCopy (unsafe 8 " start=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE step_ #-} step_ :: Convert a => a -> Attribute-step_ x = Attribute $ " step=\"" <> unConv (conv x) <> "\""+step_ x = Attribute $ U.byteStringCopy (unsafe 7 " step=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE style_ #-} style_ :: Convert a => a -> Attribute-style_ x = Attribute $ " style=\"" <> unConv (conv x) <> "\""+style_ x = Attribute $ U.byteStringCopy (unsafe 8 " style=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE summary_ #-} summary_ :: Convert a => a -> Attribute-summary_ x = Attribute $ " summary=\"" <> unConv (conv x) <> "\""+summary_ x = Attribute $ U.byteStringCopy (unsafe 10 " summary=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE tabindex_ #-} tabindex_ :: Convert a => a -> Attribute-tabindex_ x = Attribute $ " tabindex=\"" <> unConv (conv x) <> "\""+tabindex_ x = Attribute $ U.byteStringCopy (unsafe 11 " tabindex=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE target_ #-} target_ :: Convert a => a -> Attribute-target_ x = Attribute $ " target=\"" <> unConv (conv x) <> "\""+target_ x = Attribute $ U.byteStringCopy (unsafe 9 " target=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE title_ #-} title_ :: Convert a => a -> Attribute-title_ x = Attribute $ " title=\"" <> unConv (conv x) <> "\""+title_ x = Attribute $ U.byteStringCopy (unsafe 8 " title=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE type_ #-} type_ :: Convert a => a -> Attribute-type_ x = Attribute $ " type=\"" <> unConv (conv x) <> "\""+type_ x = Attribute $ U.byteStringCopy (unsafe 7 " type=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE usemap_ #-} usemap_ :: Convert a => a -> Attribute-usemap_ x = Attribute $ " usemap=\"" <> unConv (conv x) <> "\""+usemap_ x = Attribute $ U.byteStringCopy (unsafe 9 " usemap=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE value_ #-} value_ :: Convert a => a -> Attribute-value_ x = Attribute $ " value=\"" <> unConv (conv x) <> "\""+value_ x = Attribute $ U.byteStringCopy (unsafe 8 " value=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE width_ #-} width_ :: Convert a => a -> Attribute-width_ x = Attribute $ " width=\"" <> unConv (conv x) <> "\""+width_ x = Attribute $ U.byteStringCopy (unsafe 8 " width=\""#) <> unConv (convert x) <> char7 '"' {-# INLINE wrap_ #-} wrap_ :: Convert a => a -> Attribute-wrap_ x = Attribute $ " wrap=\"" <> unConv (conv x) <> "\""+wrap_ x = Attribute $ U.byteStringCopy (unsafe 7 " wrap=\""#) <> unConv (convert x) <> char7 '"'
src/Html/Convert.hs view
@@ -1,6 +1,9 @@-{-# LANGUAGE OverloadedStrings #-}-{-# LANGUAGE FlexibleInstances #-}-{-# LANGUAGE LambdaCase #-}+{-# LANGUAGE ScopedTypeVariables #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE TypeApplications #-}+{-# LANGUAGE LambdaCase #-}+{-# LANGUAGE MagicHash #-} module Html.Convert where @@ -9,48 +12,42 @@ import GHC.TypeLits import Html.Type -import qualified Data.Text.Lazy as T-import qualified Data.Text.Lazy.Encoding as T-import qualified Data.Text.Lazy.Builder as TB-import qualified Data.Text.Lazy.Builder.Int as TB-import qualified Data.Text.Lazy.Builder.RealFloat as TB-import qualified Data.ByteString.Lazy.Char8 as B--{-# INLINE escapeString #-}-escapeString :: String -> String-escapeString = concatMap $ escape pure+import Data.Char (ord) -{-# INLINE escapeText #-}-escapeText :: T.Text -> T.Text-escapeText = T.concatMap $ escape T.singleton+import qualified Data.ByteString.Builder as B+import qualified Data.ByteString.Builder.Prim as BP+import qualified Data.ByteString.Builder.Internal as U -{-# INLINE escapeByteString #-}-escapeByteString :: B.ByteString -> B.ByteString-escapeByteString = B.concatMap $ escape B.singleton+import qualified Data.Text as T+import qualified Data.Text.Encoding as T {-# INLINE escape #-}-escape :: IsString a => (Char -> a) -> Char -> a-escape f = \case- '<' -> "<"- '>' -> ">"- '&' -> "&"- '"' -> """- '\'' -> "'"- x -> f x+escape :: T.Text -> B.Builder+escape = T.encodeUtf8BuilderEscaped $+ BP.condB (> c2w '>' ) (BP.liftFixedToBounded BP.word8) $+ BP.condB (== c2w '<' ) (fixed4 (c2w '&',(c2w 'l',(c2w 't',c2w ';')))) $ -- <+ BP.condB (== c2w '>' ) (fixed4 (c2w '&',(c2w 'g',(c2w 't',c2w ';')))) $ -- >+ BP.condB (== c2w '&' ) (fixed5 (c2w '&',(c2w 'a',(c2w 'm',(c2w 'p',c2w ';'))))) $ -- &+ BP.condB (== c2w '"' ) (fixed5 (c2w '&',(c2w '#',(c2w '3',(c2w '4',c2w ';'))))) $ -- "+ BP.condB (== c2w '\'') (fixed5 (c2w '&',(c2w '#',(c2w '3',(c2w '9',c2w ';'))))) $ -- '+ BP.liftFixedToBounded BP.word8 -- fallback for Chars smaller than '>'+ where -class Conv b where- conv :: Convert a => a -> Converted b+ {-# INLINE c2w #-}+ c2w = fromIntegral . ord+ + {-# INLINE fixed4 #-}+ fixed4 x = BP.liftFixedToBounded $ const x BP.>$<+ BP.word8 BP.>*< BP.word8 BP.>*< BP.word8 BP.>*< BP.word8+ + {-# INLINE fixed5 #-}+ fixed5 x = BP.liftFixedToBounded $ const x BP.>$<+ BP.word8 BP.>*< BP.word8 BP.>*< BP.word8 BP.>*< BP.word8 BP.>*< BP.word8 -instance Conv String where- {-# INLINE conv #-}- conv = convertString-instance Conv T.Text where- {-# INLINE conv #-}- conv = convertText-instance Conv B.ByteString where- {-# INLINE conv #-}- conv = convertByteString +++ {-| Convert a type efficienctly to different string like types. Add instances if you want use custom types in your document. @@ -88,76 +85,35 @@ @ -} class Convert a where-- {-# MINIMAL convertText #-}-- convertString :: a -> Converted String- {-# INLINE convertString #-}- convertString = Converted . T.unpack . unConv . convertText-- convertText :: a -> Converted T.Text-- convertByteString :: a -> Converted B.ByteString- {-# INLINE convertByteString #-}- convertByteString = Converted . T.encodeUtf8 . unConv . convertText+ convert :: a -> Converted B.Builder instance Convert (Raw String) where- {-# INLINE convertText #-}- convertText (Raw x) = Converted (T.pack x)+ {-# INLINE convert #-}+ convert (Raw x) = Converted (fromString x) instance Convert (Raw T.Text) where- {-# INLINE convertText #-}- convertText (Raw x) = Converted x-instance Convert (Raw B.ByteString) where- {-# INLINE convertText #-}- convertText (Raw x) = Converted (T.decodeUtf8 x)- {-# INLINE convertByteString #-}- convertByteString (Raw x) = Converted x+ {-# INLINE convert #-}+ convert (Raw x) = Converted (T.encodeUtf8Builder x) instance Convert String where- {-# INLINE convertString #-}- convertString = Converted . escapeString- {-# INLINE convertText #-}- convertText = Converted . escapeText . T.pack+ {-# INLINE convert #-}+ convert = Converted . escape . fromString instance Convert T.Text where- {-# INLINE convertText #-}- convertText = Converted . escapeText+ {-# INLINE convert #-}+ convert = Converted . escape instance Convert Int where- {-# INLINE convertString #-}- convertString = Converted . show- {-# INLINE convertText #-}- convertText = Converted . TB.toLazyText . TB.decimal- {-# INLINE convertByteString #-}- convertByteString = Converted . B.pack . show+ {-# INLINE convert #-}+ convert = Converted . B.intDec instance Convert Integer where- {-# INLINE convertString #-}- convertString = Converted . show- {-# INLINE convertText #-}- convertText = Converted . TB.toLazyText . TB.decimal- {-# INLINE convertByteString #-}- convertByteString = Converted . B.pack . show+ {-# INLINE convert #-}+ convert = Converted . B.integerDec instance Convert Float where- {-# INLINE convertString #-}- convertString = Converted . show- {-# INLINE convertText #-}- convertText = Converted . TB.toLazyText . TB.realFloat- {-# INLINE convertByteString #-}- convertByteString = Converted . B.pack . show+ {-# INLINE convert #-}+ convert = Converted . B.floatDec instance Convert Double where- convertString = Converted . show- {-# INLINE convertText #-}- convertText = Converted . TB.toLazyText . TB.realFloat- {-# INLINE convertByteString #-}- convertByteString = Converted . B.pack . show+ {-# INLINE convert #-}+ convert = Converted . B.doubleDec instance Convert Word where- {-# INLINE convertString #-}- convertString = Converted . show- {-# INLINE convertText #-}- convertText = Converted . TB.toLazyText . TB.decimal- {-# INLINE convertByteString #-}- convertByteString = Converted . B.pack . show+ {-# INLINE convert #-}+ convert = Converted . B.wordDec instance KnownSymbol a => Convert (Proxy a) where- {-# INLINE convertString #-}- convertString = Converted . symbolVal- {-# INLINE convertText #-}- convertText = Converted . T.pack . symbolVal- {-# INLINE convertByteString #-}- convertByteString = Converted . B.pack . symbolVal+ {-# INLINE convert #-}+ convert = Converted . U.byteStringCopy . fromString . symbolVal
src/Html/Element.hs view
@@ -13,875 +13,875 @@ a_ :: ('A ?> a) => a -> 'A > a a_ = Child -a_A :: ('A ?> a) => [Attribute] -> a -> 'A :> a+a_A :: ('A ?> a) => Attribute -> a -> 'A :> a a_A = WithAttributes abbr_ :: ('Abbr ?> a) => a -> 'Abbr > a abbr_ = Child -abbr_A :: ('Abbr ?> a) => [Attribute] -> a -> 'Abbr :> a+abbr_A :: ('Abbr ?> a) => Attribute -> a -> 'Abbr :> a abbr_A = WithAttributes acronym_ :: ('Acronym ?> a) => a -> 'Acronym > a acronym_ = Child -acronym_A :: ('Acronym ?> a) => [Attribute] -> a -> 'Acronym :> a+acronym_A :: ('Acronym ?> a) => Attribute -> a -> 'Acronym :> a acronym_A = WithAttributes address_ :: ('Address ?> a) => a -> 'Address > a address_ = Child -address_A :: ('Address ?> a) => [Attribute] -> a -> 'Address :> a+address_A :: ('Address ?> a) => Attribute -> a -> 'Address :> a address_A = WithAttributes applet_ :: ('Applet ?> a) => a -> 'Applet > a applet_ = Child -applet_A :: ('Applet ?> a) => [Attribute] -> a -> 'Applet :> a+applet_A :: ('Applet ?> a) => Attribute -> a -> 'Applet :> a applet_A = WithAttributes area_ :: 'Area > () area_ = Child () -area_A :: [Attribute] -> 'Area :> ()+area_A :: Attribute -> 'Area :> () area_A = flip WithAttributes () article_ :: ('Article ?> a) => a -> 'Article > a article_ = Child -article_A :: ('Article ?> a) => [Attribute] -> a -> 'Article :> a+article_A :: ('Article ?> a) => Attribute -> a -> 'Article :> a article_A = WithAttributes aside_ :: ('Aside ?> a) => a -> 'Aside > a aside_ = Child -aside_A :: ('Aside ?> a) => [Attribute] -> a -> 'Aside :> a+aside_A :: ('Aside ?> a) => Attribute -> a -> 'Aside :> a aside_A = WithAttributes audio_ :: ('Audio ?> a) => a -> 'Audio > a audio_ = Child -audio_A :: ('Audio ?> a) => [Attribute] -> a -> 'Audio :> a+audio_A :: ('Audio ?> a) => Attribute -> a -> 'Audio :> a audio_A = WithAttributes b_ :: ('B ?> a) => a -> 'B > a b_ = Child -b_A :: ('B ?> a) => [Attribute] -> a -> 'B :> a+b_A :: ('B ?> a) => Attribute -> a -> 'B :> a b_A = WithAttributes base_ :: 'Base > () base_ = Child () -base_A :: [Attribute] -> 'Base :> ()+base_A :: Attribute -> 'Base :> () base_A = flip WithAttributes () basefont_ :: ('Basefont ?> a) => a -> 'Basefont > a basefont_ = Child -basefont_A :: ('Basefont ?> a) => [Attribute] -> a -> 'Basefont :> a+basefont_A :: ('Basefont ?> a) => Attribute -> a -> 'Basefont :> a basefont_A = WithAttributes bdi_ :: ('Bdi ?> a) => a -> 'Bdi > a bdi_ = Child -bdi_A :: ('Bdi ?> a) => [Attribute] -> a -> 'Bdi :> a+bdi_A :: ('Bdi ?> a) => Attribute -> a -> 'Bdi :> a bdi_A = WithAttributes bdo_ :: ('Bdo ?> a) => a -> 'Bdo > a bdo_ = Child -bdo_A :: ('Bdo ?> a) => [Attribute] -> a -> 'Bdo :> a+bdo_A :: ('Bdo ?> a) => Attribute -> a -> 'Bdo :> a bdo_A = WithAttributes bgsound_ :: ('Bgsound ?> a) => a -> 'Bgsound > a bgsound_ = Child -bgsound_A :: ('Bgsound ?> a) => [Attribute] -> a -> 'Bgsound :> a+bgsound_A :: ('Bgsound ?> a) => Attribute -> a -> 'Bgsound :> a bgsound_A = WithAttributes big_ :: ('Big ?> a) => a -> 'Big > a big_ = Child -big_A :: ('Big ?> a) => [Attribute] -> a -> 'Big :> a+big_A :: ('Big ?> a) => Attribute -> a -> 'Big :> a big_A = WithAttributes blink_ :: ('Blink ?> a) => a -> 'Blink > a blink_ = Child -blink_A :: ('Blink ?> a) => [Attribute] -> a -> 'Blink :> a+blink_A :: ('Blink ?> a) => Attribute -> a -> 'Blink :> a blink_A = WithAttributes blockquote_ :: ('Blockquote ?> a) => a -> 'Blockquote > a blockquote_ = Child -blockquote_A :: ('Blockquote ?> a) => [Attribute] -> a -> 'Blockquote :> a+blockquote_A :: ('Blockquote ?> a) => Attribute -> a -> 'Blockquote :> a blockquote_A = WithAttributes body_ :: ('Body ?> a) => a -> 'Body > a body_ = Child -body_A :: ('Body ?> a) => [Attribute] -> a -> 'Body :> a+body_A :: ('Body ?> a) => Attribute -> a -> 'Body :> a body_A = WithAttributes br_ :: 'Br > () br_ = Child () -br_A :: [Attribute] -> 'Br :> ()+br_A :: Attribute -> 'Br :> () br_A = flip WithAttributes () button_ :: ('Button ?> a) => a -> 'Button > a button_ = Child -button_A :: ('Button ?> a) => [Attribute] -> a -> 'Button :> a+button_A :: ('Button ?> a) => Attribute -> a -> 'Button :> a button_A = WithAttributes canvas_ :: ('Canvas ?> a) => a -> 'Canvas > a canvas_ = Child -canvas_A :: ('Canvas ?> a) => [Attribute] -> a -> 'Canvas :> a+canvas_A :: ('Canvas ?> a) => Attribute -> a -> 'Canvas :> a canvas_A = WithAttributes caption_ :: ('Caption ?> a) => a -> 'Caption > a caption_ = Child -caption_A :: ('Caption ?> a) => [Attribute] -> a -> 'Caption :> a+caption_A :: ('Caption ?> a) => Attribute -> a -> 'Caption :> a caption_A = WithAttributes center_ :: ('Center ?> a) => a -> 'Center > a center_ = Child -center_A :: ('Center ?> a) => [Attribute] -> a -> 'Center :> a+center_A :: ('Center ?> a) => Attribute -> a -> 'Center :> a center_A = WithAttributes cite_ :: ('Cite ?> a) => a -> 'Cite > a cite_ = Child -cite_A :: ('Cite ?> a) => [Attribute] -> a -> 'Cite :> a+cite_A :: ('Cite ?> a) => Attribute -> a -> 'Cite :> a cite_A = WithAttributes code_ :: ('Code ?> a) => a -> 'Code > a code_ = Child -code_A :: ('Code ?> a) => [Attribute] -> a -> 'Code :> a+code_A :: ('Code ?> a) => Attribute -> a -> 'Code :> a code_A = WithAttributes col_ :: 'Col > () col_ = Child () -col_A :: [Attribute] -> 'Col :> ()+col_A :: Attribute -> 'Col :> () col_A = flip WithAttributes () colgroup_ :: ('Colgroup ?> a) => a -> 'Colgroup > a colgroup_ = Child -colgroup_A :: ('Colgroup ?> a) => [Attribute] -> a -> 'Colgroup :> a+colgroup_A :: ('Colgroup ?> a) => Attribute -> a -> 'Colgroup :> a colgroup_A = WithAttributes command_ :: ('Command ?> a) => a -> 'Command > a command_ = Child -command_A :: ('Command ?> a) => [Attribute] -> a -> 'Command :> a+command_A :: ('Command ?> a) => Attribute -> a -> 'Command :> a command_A = WithAttributes content_ :: ('Content ?> a) => a -> 'Content > a content_ = Child -content_A :: ('Content ?> a) => [Attribute] -> a -> 'Content :> a+content_A :: ('Content ?> a) => Attribute -> a -> 'Content :> a content_A = WithAttributes data_ :: ('Data ?> a) => a -> 'Data > a data_ = Child -data_A :: ('Data ?> a) => [Attribute] -> a -> 'Data :> a+data_A :: ('Data ?> a) => Attribute -> a -> 'Data :> a data_A = WithAttributes datalist_ :: ('Datalist ?> a) => a -> 'Datalist > a datalist_ = Child -datalist_A :: ('Datalist ?> a) => [Attribute] -> a -> 'Datalist :> a+datalist_A :: ('Datalist ?> a) => Attribute -> a -> 'Datalist :> a datalist_A = WithAttributes dd_ :: ('Dd ?> a) => a -> 'Dd > a dd_ = Child -dd_A :: ('Dd ?> a) => [Attribute] -> a -> 'Dd :> a+dd_A :: ('Dd ?> a) => Attribute -> a -> 'Dd :> a dd_A = WithAttributes del_ :: ('Del ?> a) => a -> 'Del > a del_ = Child -del_A :: ('Del ?> a) => [Attribute] -> a -> 'Del :> a+del_A :: ('Del ?> a) => Attribute -> a -> 'Del :> a del_A = WithAttributes details_ :: ('Details ?> a) => a -> 'Details > a details_ = Child -details_A :: ('Details ?> a) => [Attribute] -> a -> 'Details :> a+details_A :: ('Details ?> a) => Attribute -> a -> 'Details :> a details_A = WithAttributes dfn_ :: ('Dfn ?> a) => a -> 'Dfn > a dfn_ = Child -dfn_A :: ('Dfn ?> a) => [Attribute] -> a -> 'Dfn :> a+dfn_A :: ('Dfn ?> a) => Attribute -> a -> 'Dfn :> a dfn_A = WithAttributes dialog_ :: ('Dialog ?> a) => a -> 'Dialog > a dialog_ = Child -dialog_A :: ('Dialog ?> a) => [Attribute] -> a -> 'Dialog :> a+dialog_A :: ('Dialog ?> a) => Attribute -> a -> 'Dialog :> a dialog_A = WithAttributes dir_ :: ('Dir ?> a) => a -> 'Dir > a dir_ = Child -dir_A :: ('Dir ?> a) => [Attribute] -> a -> 'Dir :> a+dir_A :: ('Dir ?> a) => Attribute -> a -> 'Dir :> a dir_A = WithAttributes div_ :: ('Div ?> a) => a -> 'Div > a div_ = Child -div_A :: ('Div ?> a) => [Attribute] -> a -> 'Div :> a+div_A :: ('Div ?> a) => Attribute -> a -> 'Div :> a div_A = WithAttributes dl_ :: ('Dl ?> a) => a -> 'Dl > a dl_ = Child -dl_A :: ('Dl ?> a) => [Attribute] -> a -> 'Dl :> a+dl_A :: ('Dl ?> a) => Attribute -> a -> 'Dl :> a dl_A = WithAttributes dt_ :: ('Dt ?> a) => a -> 'Dt > a dt_ = Child -dt_A :: ('Dt ?> a) => [Attribute] -> a -> 'Dt :> a+dt_A :: ('Dt ?> a) => Attribute -> a -> 'Dt :> a dt_A = WithAttributes element_ :: ('Element ?> a) => a -> 'Element > a element_ = Child -element_A :: ('Element ?> a) => [Attribute] -> a -> 'Element :> a+element_A :: ('Element ?> a) => Attribute -> a -> 'Element :> a element_A = WithAttributes em_ :: ('Em ?> a) => a -> 'Em > a em_ = Child -em_A :: ('Em ?> a) => [Attribute] -> a -> 'Em :> a+em_A :: ('Em ?> a) => Attribute -> a -> 'Em :> a em_A = WithAttributes embed_ :: 'Embed > () embed_ = Child () -embed_A :: [Attribute] -> 'Embed :> ()+embed_A :: Attribute -> 'Embed :> () embed_A = flip WithAttributes () fieldset_ :: ('Fieldset ?> a) => a -> 'Fieldset > a fieldset_ = Child -fieldset_A :: ('Fieldset ?> a) => [Attribute] -> a -> 'Fieldset :> a+fieldset_A :: ('Fieldset ?> a) => Attribute -> a -> 'Fieldset :> a fieldset_A = WithAttributes figcaption_ :: ('Figcaption ?> a) => a -> 'Figcaption > a figcaption_ = Child -figcaption_A :: ('Figcaption ?> a) => [Attribute] -> a -> 'Figcaption :> a+figcaption_A :: ('Figcaption ?> a) => Attribute -> a -> 'Figcaption :> a figcaption_A = WithAttributes figure_ :: ('Figure ?> a) => a -> 'Figure > a figure_ = Child -figure_A :: ('Figure ?> a) => [Attribute] -> a -> 'Figure :> a+figure_A :: ('Figure ?> a) => Attribute -> a -> 'Figure :> a figure_A = WithAttributes font_ :: ('Font ?> a) => a -> 'Font > a font_ = Child -font_A :: ('Font ?> a) => [Attribute] -> a -> 'Font :> a+font_A :: ('Font ?> a) => Attribute -> a -> 'Font :> a font_A = WithAttributes footer_ :: ('Footer ?> a) => a -> 'Footer > a footer_ = Child -footer_A :: ('Footer ?> a) => [Attribute] -> a -> 'Footer :> a+footer_A :: ('Footer ?> a) => Attribute -> a -> 'Footer :> a footer_A = WithAttributes form_ :: ('Form ?> a) => a -> 'Form > a form_ = Child -form_A :: ('Form ?> a) => [Attribute] -> a -> 'Form :> a+form_A :: ('Form ?> a) => Attribute -> a -> 'Form :> a form_A = WithAttributes frame_ :: ('Frame ?> a) => a -> 'Frame > a frame_ = Child -frame_A :: ('Frame ?> a) => [Attribute] -> a -> 'Frame :> a+frame_A :: ('Frame ?> a) => Attribute -> a -> 'Frame :> a frame_A = WithAttributes frameset_ :: ('Frameset ?> a) => a -> 'Frameset > a frameset_ = Child -frameset_A :: ('Frameset ?> a) => [Attribute] -> a -> 'Frameset :> a+frameset_A :: ('Frameset ?> a) => Attribute -> a -> 'Frameset :> a frameset_A = WithAttributes h1_ :: ('H1 ?> a) => a -> 'H1 > a h1_ = Child -h1_A :: ('H1 ?> a) => [Attribute] -> a -> 'H1 :> a+h1_A :: ('H1 ?> a) => Attribute -> a -> 'H1 :> a h1_A = WithAttributes h2_ :: ('H2 ?> a) => a -> 'H2 > a h2_ = Child -h2_A :: ('H2 ?> a) => [Attribute] -> a -> 'H2 :> a+h2_A :: ('H2 ?> a) => Attribute -> a -> 'H2 :> a h2_A = WithAttributes h3_ :: ('H3 ?> a) => a -> 'H3 > a h3_ = Child -h3_A :: ('H3 ?> a) => [Attribute] -> a -> 'H3 :> a+h3_A :: ('H3 ?> a) => Attribute -> a -> 'H3 :> a h3_A = WithAttributes h4_ :: ('H4 ?> a) => a -> 'H4 > a h4_ = Child -h4_A :: ('H4 ?> a) => [Attribute] -> a -> 'H4 :> a+h4_A :: ('H4 ?> a) => Attribute -> a -> 'H4 :> a h4_A = WithAttributes h5_ :: ('H5 ?> a) => a -> 'H5 > a h5_ = Child -h5_A :: ('H5 ?> a) => [Attribute] -> a -> 'H5 :> a+h5_A :: ('H5 ?> a) => Attribute -> a -> 'H5 :> a h5_A = WithAttributes h6_ :: ('H6 ?> a) => a -> 'H6 > a h6_ = Child -h6_A :: ('H6 ?> a) => [Attribute] -> a -> 'H6 :> a+h6_A :: ('H6 ?> a) => Attribute -> a -> 'H6 :> a h6_A = WithAttributes head_ :: ('Head ?> a) => a -> 'Head > a head_ = Child -head_A :: ('Head ?> a) => [Attribute] -> a -> 'Head :> a+head_A :: ('Head ?> a) => Attribute -> a -> 'Head :> a head_A = WithAttributes header_ :: ('Header ?> a) => a -> 'Header > a header_ = Child -header_A :: ('Header ?> a) => [Attribute] -> a -> 'Header :> a+header_A :: ('Header ?> a) => Attribute -> a -> 'Header :> a header_A = WithAttributes hgroup_ :: ('Hgroup ?> a) => a -> 'Hgroup > a hgroup_ = Child -hgroup_A :: ('Hgroup ?> a) => [Attribute] -> a -> 'Hgroup :> a+hgroup_A :: ('Hgroup ?> a) => Attribute -> a -> 'Hgroup :> a hgroup_A = WithAttributes hr_ :: 'Hr > () hr_ = Child () -hr_A :: [Attribute] -> 'Hr :> ()+hr_A :: Attribute -> 'Hr :> () hr_A = flip WithAttributes () html_ :: ('Html ?> a) => a -> 'Html > a html_ = Child -html_A :: ('Html ?> a) => [Attribute] -> a -> 'Html :> a+html_A :: ('Html ?> a) => Attribute -> a -> 'Html :> a html_A = WithAttributes i_ :: ('I ?> a) => a -> 'I > a i_ = Child -i_A :: ('I ?> a) => [Attribute] -> a -> 'I :> a+i_A :: ('I ?> a) => Attribute -> a -> 'I :> a i_A = WithAttributes iframe_ :: 'Iframe > () iframe_ = Child () -iframe_A :: [Attribute] -> 'Iframe :> ()+iframe_A :: Attribute -> 'Iframe :> () iframe_A = flip WithAttributes () image_ :: ('Image ?> a) => a -> 'Image > a image_ = Child -image_A :: ('Image ?> a) => [Attribute] -> a -> 'Image :> a+image_A :: ('Image ?> a) => Attribute -> a -> 'Image :> a image_A = WithAttributes img_ :: 'Img > () img_ = Child () -img_A :: [Attribute] -> 'Img :> ()+img_A :: Attribute -> 'Img :> () img_A = flip WithAttributes () input_ :: ('Input ?> a) => a -> 'Input > a input_ = Child -input_A :: ('Input ?> a) => [Attribute] -> a -> 'Input :> a+input_A :: ('Input ?> a) => Attribute -> a -> 'Input :> a input_A = WithAttributes ins_ :: ('Ins ?> a) => a -> 'Ins > a ins_ = Child -ins_A :: ('Ins ?> a) => [Attribute] -> a -> 'Ins :> a+ins_A :: ('Ins ?> a) => Attribute -> a -> 'Ins :> a ins_A = WithAttributes isindex_ :: ('Isindex ?> a) => a -> 'Isindex > a isindex_ = Child -isindex_A :: ('Isindex ?> a) => [Attribute] -> a -> 'Isindex :> a+isindex_A :: ('Isindex ?> a) => Attribute -> a -> 'Isindex :> a isindex_A = WithAttributes kbd_ :: ('Kbd ?> a) => a -> 'Kbd > a kbd_ = Child -kbd_A :: ('Kbd ?> a) => [Attribute] -> a -> 'Kbd :> a+kbd_A :: ('Kbd ?> a) => Attribute -> a -> 'Kbd :> a kbd_A = WithAttributes keygen_ :: ('Keygen ?> a) => a -> 'Keygen > a keygen_ = Child -keygen_A :: ('Keygen ?> a) => [Attribute] -> a -> 'Keygen :> a+keygen_A :: ('Keygen ?> a) => Attribute -> a -> 'Keygen :> a keygen_A = WithAttributes label_ :: ('Label ?> a) => a -> 'Label > a label_ = Child -label_A :: ('Label ?> a) => [Attribute] -> a -> 'Label :> a+label_A :: ('Label ?> a) => Attribute -> a -> 'Label :> a label_A = WithAttributes legend_ :: ('Legend ?> a) => a -> 'Legend > a legend_ = Child -legend_A :: ('Legend ?> a) => [Attribute] -> a -> 'Legend :> a+legend_A :: ('Legend ?> a) => Attribute -> a -> 'Legend :> a legend_A = WithAttributes li_ :: ('Li ?> a) => a -> 'Li > a li_ = Child -li_A :: ('Li ?> a) => [Attribute] -> a -> 'Li :> a+li_A :: ('Li ?> a) => Attribute -> a -> 'Li :> a li_A = WithAttributes link_ :: 'Link > () link_ = Child () -link_A :: [Attribute] -> 'Link :> ()+link_A :: Attribute -> 'Link :> () link_A = flip WithAttributes () listing_ :: ('Listing ?> a) => a -> 'Listing > a listing_ = Child -listing_A :: ('Listing ?> a) => [Attribute] -> a -> 'Listing :> a+listing_A :: ('Listing ?> a) => Attribute -> a -> 'Listing :> a listing_A = WithAttributes main_ :: ('Main ?> a) => a -> 'Main > a main_ = Child -main_A :: ('Main ?> a) => [Attribute] -> a -> 'Main :> a+main_A :: ('Main ?> a) => Attribute -> a -> 'Main :> a main_A = WithAttributes map_ :: ('Map ?> a) => a -> 'Map > a map_ = Child -map_A :: ('Map ?> a) => [Attribute] -> a -> 'Map :> a+map_A :: ('Map ?> a) => Attribute -> a -> 'Map :> a map_A = WithAttributes mark_ :: ('Mark ?> a) => a -> 'Mark > a mark_ = Child -mark_A :: ('Mark ?> a) => [Attribute] -> a -> 'Mark :> a+mark_A :: ('Mark ?> a) => Attribute -> a -> 'Mark :> a mark_A = WithAttributes marquee_ :: ('Marquee ?> a) => a -> 'Marquee > a marquee_ = Child -marquee_A :: ('Marquee ?> a) => [Attribute] -> a -> 'Marquee :> a+marquee_A :: ('Marquee ?> a) => Attribute -> a -> 'Marquee :> a marquee_A = WithAttributes math_ :: ('Math ?> a) => a -> 'Math > a math_ = Child -math_A :: ('Math ?> a) => [Attribute] -> a -> 'Math :> a+math_A :: ('Math ?> a) => Attribute -> a -> 'Math :> a math_A = WithAttributes menu_ :: ('Menu ?> a) => a -> 'Menu > a menu_ = Child -menu_A :: ('Menu ?> a) => [Attribute] -> a -> 'Menu :> a+menu_A :: ('Menu ?> a) => Attribute -> a -> 'Menu :> a menu_A = WithAttributes menuitem_ :: 'Menuitem > () menuitem_ = Child () -menuitem_A :: [Attribute] -> 'Menuitem :> ()+menuitem_A :: Attribute -> 'Menuitem :> () menuitem_A = flip WithAttributes () meta_ :: 'Meta > () meta_ = Child () -meta_A :: [Attribute] -> 'Meta :> ()+meta_A :: Attribute -> 'Meta :> () meta_A = flip WithAttributes () meter_ :: ('Meter ?> a) => a -> 'Meter > a meter_ = Child -meter_A :: ('Meter ?> a) => [Attribute] -> a -> 'Meter :> a+meter_A :: ('Meter ?> a) => Attribute -> a -> 'Meter :> a meter_A = WithAttributes multicol_ :: ('Multicol ?> a) => a -> 'Multicol > a multicol_ = Child -multicol_A :: ('Multicol ?> a) => [Attribute] -> a -> 'Multicol :> a+multicol_A :: ('Multicol ?> a) => Attribute -> a -> 'Multicol :> a multicol_A = WithAttributes nav_ :: ('Nav ?> a) => a -> 'Nav > a nav_ = Child -nav_A :: ('Nav ?> a) => [Attribute] -> a -> 'Nav :> a+nav_A :: ('Nav ?> a) => Attribute -> a -> 'Nav :> a nav_A = WithAttributes nextid_ :: ('Nextid ?> a) => a -> 'Nextid > a nextid_ = Child -nextid_A :: ('Nextid ?> a) => [Attribute] -> a -> 'Nextid :> a+nextid_A :: ('Nextid ?> a) => Attribute -> a -> 'Nextid :> a nextid_A = WithAttributes nobr_ :: ('Nobr ?> a) => a -> 'Nobr > a nobr_ = Child -nobr_A :: ('Nobr ?> a) => [Attribute] -> a -> 'Nobr :> a+nobr_A :: ('Nobr ?> a) => Attribute -> a -> 'Nobr :> a nobr_A = WithAttributes noembed_ :: ('Noembed ?> a) => a -> 'Noembed > a noembed_ = Child -noembed_A :: ('Noembed ?> a) => [Attribute] -> a -> 'Noembed :> a+noembed_A :: ('Noembed ?> a) => Attribute -> a -> 'Noembed :> a noembed_A = WithAttributes noframes_ :: ('Noframes ?> a) => a -> 'Noframes > a noframes_ = Child -noframes_A :: ('Noframes ?> a) => [Attribute] -> a -> 'Noframes :> a+noframes_A :: ('Noframes ?> a) => Attribute -> a -> 'Noframes :> a noframes_A = WithAttributes noscript_ :: ('Noscript ?> a) => a -> 'Noscript > a noscript_ = Child -noscript_A :: ('Noscript ?> a) => [Attribute] -> a -> 'Noscript :> a+noscript_A :: ('Noscript ?> a) => Attribute -> a -> 'Noscript :> a noscript_A = WithAttributes object_ :: ('Object ?> a) => a -> 'Object > a object_ = Child -object_A :: ('Object ?> a) => [Attribute] -> a -> 'Object :> a+object_A :: ('Object ?> a) => Attribute -> a -> 'Object :> a object_A = WithAttributes ol_ :: ('Ol ?> a) => a -> 'Ol > a ol_ = Child -ol_A :: ('Ol ?> a) => [Attribute] -> a -> 'Ol :> a+ol_A :: ('Ol ?> a) => Attribute -> a -> 'Ol :> a ol_A = WithAttributes optgroup_ :: ('Optgroup ?> a) => a -> 'Optgroup > a optgroup_ = Child -optgroup_A :: ('Optgroup ?> a) => [Attribute] -> a -> 'Optgroup :> a+optgroup_A :: ('Optgroup ?> a) => Attribute -> a -> 'Optgroup :> a optgroup_A = WithAttributes option_ :: ('Option ?> a) => a -> 'Option > a option_ = Child -option_A :: ('Option ?> a) => [Attribute] -> a -> 'Option :> a+option_A :: ('Option ?> a) => Attribute -> a -> 'Option :> a option_A = WithAttributes output_ :: ('Output ?> a) => a -> 'Output > a output_ = Child -output_A :: ('Output ?> a) => [Attribute] -> a -> 'Output :> a+output_A :: ('Output ?> a) => Attribute -> a -> 'Output :> a output_A = WithAttributes p_ :: ('P ?> a) => a -> 'P > a p_ = Child -p_A :: ('P ?> a) => [Attribute] -> a -> 'P :> a+p_A :: ('P ?> a) => Attribute -> a -> 'P :> a p_A = WithAttributes param_ :: 'Param > () param_ = Child () -param_A :: [Attribute] -> 'Param :> ()+param_A :: Attribute -> 'Param :> () param_A = flip WithAttributes () picture_ :: ('Picture ?> a) => a -> 'Picture > a picture_ = Child -picture_A :: ('Picture ?> a) => [Attribute] -> a -> 'Picture :> a+picture_A :: ('Picture ?> a) => Attribute -> a -> 'Picture :> a picture_A = WithAttributes plaintext_ :: ('Plaintext ?> a) => a -> 'Plaintext > a plaintext_ = Child -plaintext_A :: ('Plaintext ?> a) => [Attribute] -> a -> 'Plaintext :> a+plaintext_A :: ('Plaintext ?> a) => Attribute -> a -> 'Plaintext :> a plaintext_A = WithAttributes pre_ :: ('Pre ?> a) => a -> 'Pre > a pre_ = Child -pre_A :: ('Pre ?> a) => [Attribute] -> a -> 'Pre :> a+pre_A :: ('Pre ?> a) => Attribute -> a -> 'Pre :> a pre_A = WithAttributes progress_ :: ('Progress ?> a) => a -> 'Progress > a progress_ = Child -progress_A :: ('Progress ?> a) => [Attribute] -> a -> 'Progress :> a+progress_A :: ('Progress ?> a) => Attribute -> a -> 'Progress :> a progress_A = WithAttributes q_ :: ('Q ?> a) => a -> 'Q > a q_ = Child -q_A :: ('Q ?> a) => [Attribute] -> a -> 'Q :> a+q_A :: ('Q ?> a) => Attribute -> a -> 'Q :> a q_A = WithAttributes rp_ :: ('Rp ?> a) => a -> 'Rp > a rp_ = Child -rp_A :: ('Rp ?> a) => [Attribute] -> a -> 'Rp :> a+rp_A :: ('Rp ?> a) => Attribute -> a -> 'Rp :> a rp_A = WithAttributes rt_ :: ('Rt ?> a) => a -> 'Rt > a rt_ = Child -rt_A :: ('Rt ?> a) => [Attribute] -> a -> 'Rt :> a+rt_A :: ('Rt ?> a) => Attribute -> a -> 'Rt :> a rt_A = WithAttributes rtc_ :: ('Rtc ?> a) => a -> 'Rtc > a rtc_ = Child -rtc_A :: ('Rtc ?> a) => [Attribute] -> a -> 'Rtc :> a+rtc_A :: ('Rtc ?> a) => Attribute -> a -> 'Rtc :> a rtc_A = WithAttributes ruby_ :: ('Ruby ?> a) => a -> 'Ruby > a ruby_ = Child -ruby_A :: ('Ruby ?> a) => [Attribute] -> a -> 'Ruby :> a+ruby_A :: ('Ruby ?> a) => Attribute -> a -> 'Ruby :> a ruby_A = WithAttributes s_ :: ('S ?> a) => a -> 'S > a s_ = Child -s_A :: ('S ?> a) => [Attribute] -> a -> 'S :> a+s_A :: ('S ?> a) => Attribute -> a -> 'S :> a s_A = WithAttributes samp_ :: ('Samp ?> a) => a -> 'Samp > a samp_ = Child -samp_A :: ('Samp ?> a) => [Attribute] -> a -> 'Samp :> a+samp_A :: ('Samp ?> a) => Attribute -> a -> 'Samp :> a samp_A = WithAttributes script_ :: ('Script ?> a) => a -> 'Script > a script_ = Child -script_A :: ('Script ?> a) => [Attribute] -> a -> 'Script :> a+script_A :: ('Script ?> a) => Attribute -> a -> 'Script :> a script_A = WithAttributes section_ :: ('Section ?> a) => a -> 'Section > a section_ = Child -section_A :: ('Section ?> a) => [Attribute] -> a -> 'Section :> a+section_A :: ('Section ?> a) => Attribute -> a -> 'Section :> a section_A = WithAttributes select_ :: ('Select ?> a) => a -> 'Select > a select_ = Child -select_A :: ('Select ?> a) => [Attribute] -> a -> 'Select :> a+select_A :: ('Select ?> a) => Attribute -> a -> 'Select :> a select_A = WithAttributes shadow_ :: ('Shadow ?> a) => a -> 'Shadow > a shadow_ = Child -shadow_A :: ('Shadow ?> a) => [Attribute] -> a -> 'Shadow :> a+shadow_A :: ('Shadow ?> a) => Attribute -> a -> 'Shadow :> a shadow_A = WithAttributes slot_ :: ('Slot ?> a) => a -> 'Slot > a slot_ = Child -slot_A :: ('Slot ?> a) => [Attribute] -> a -> 'Slot :> a+slot_A :: ('Slot ?> a) => Attribute -> a -> 'Slot :> a slot_A = WithAttributes small_ :: ('Small ?> a) => a -> 'Small > a small_ = Child -small_A :: ('Small ?> a) => [Attribute] -> a -> 'Small :> a+small_A :: ('Small ?> a) => Attribute -> a -> 'Small :> a small_A = WithAttributes source_ :: 'Source > () source_ = Child () -source_A :: [Attribute] -> 'Source :> ()+source_A :: Attribute -> 'Source :> () source_A = flip WithAttributes () spacer_ :: ('Spacer ?> a) => a -> 'Spacer > a spacer_ = Child -spacer_A :: ('Spacer ?> a) => [Attribute] -> a -> 'Spacer :> a+spacer_A :: ('Spacer ?> a) => Attribute -> a -> 'Spacer :> a spacer_A = WithAttributes span_ :: ('Span ?> a) => a -> 'Span > a span_ = Child -span_A :: ('Span ?> a) => [Attribute] -> a -> 'Span :> a+span_A :: ('Span ?> a) => Attribute -> a -> 'Span :> a span_A = WithAttributes strike_ :: ('Strike ?> a) => a -> 'Strike > a strike_ = Child -strike_A :: ('Strike ?> a) => [Attribute] -> a -> 'Strike :> a+strike_A :: ('Strike ?> a) => Attribute -> a -> 'Strike :> a strike_A = WithAttributes strong_ :: ('Strong ?> a) => a -> 'Strong > a strong_ = Child -strong_A :: ('Strong ?> a) => [Attribute] -> a -> 'Strong :> a+strong_A :: ('Strong ?> a) => Attribute -> a -> 'Strong :> a strong_A = WithAttributes style_ :: ('Style ?> a) => a -> 'Style > a style_ = Child -style_A :: ('Style ?> a) => [Attribute] -> a -> 'Style :> a+style_A :: ('Style ?> a) => Attribute -> a -> 'Style :> a style_A = WithAttributes sub_ :: ('Sub ?> a) => a -> 'Sub > a sub_ = Child -sub_A :: ('Sub ?> a) => [Attribute] -> a -> 'Sub :> a+sub_A :: ('Sub ?> a) => Attribute -> a -> 'Sub :> a sub_A = WithAttributes summary_ :: ('Summary ?> a) => a -> 'Summary > a summary_ = Child -summary_A :: ('Summary ?> a) => [Attribute] -> a -> 'Summary :> a+summary_A :: ('Summary ?> a) => Attribute -> a -> 'Summary :> a summary_A = WithAttributes sup_ :: ('Sup ?> a) => a -> 'Sup > a sup_ = Child -sup_A :: ('Sup ?> a) => [Attribute] -> a -> 'Sup :> a+sup_A :: ('Sup ?> a) => Attribute -> a -> 'Sup :> a sup_A = WithAttributes svg_ :: ('Svg ?> a) => a -> 'Svg > a svg_ = Child -svg_A :: ('Svg ?> a) => [Attribute] -> a -> 'Svg :> a+svg_A :: ('Svg ?> a) => Attribute -> a -> 'Svg :> a svg_A = WithAttributes table_ :: ('Table ?> a) => a -> 'Table > a table_ = Child -table_A :: ('Table ?> a) => [Attribute] -> a -> 'Table :> a+table_A :: ('Table ?> a) => Attribute -> a -> 'Table :> a table_A = WithAttributes tbody_ :: ('Tbody ?> a) => a -> 'Tbody > a tbody_ = Child -tbody_A :: ('Tbody ?> a) => [Attribute] -> a -> 'Tbody :> a+tbody_A :: ('Tbody ?> a) => Attribute -> a -> 'Tbody :> a tbody_A = WithAttributes td_ :: ('Td ?> a) => a -> 'Td > a td_ = Child -td_A :: ('Td ?> a) => [Attribute] -> a -> 'Td :> a+td_A :: ('Td ?> a) => Attribute -> a -> 'Td :> a td_A = WithAttributes template_ :: ('Template ?> a) => a -> 'Template > a template_ = Child -template_A :: ('Template ?> a) => [Attribute] -> a -> 'Template :> a+template_A :: ('Template ?> a) => Attribute -> a -> 'Template :> a template_A = WithAttributes textarea_ :: ('Textarea ?> a) => a -> 'Textarea > a textarea_ = Child -textarea_A :: ('Textarea ?> a) => [Attribute] -> a -> 'Textarea :> a+textarea_A :: ('Textarea ?> a) => Attribute -> a -> 'Textarea :> a textarea_A = WithAttributes tfoot_ :: ('Tfoot ?> a) => a -> 'Tfoot > a tfoot_ = Child -tfoot_A :: ('Tfoot ?> a) => [Attribute] -> a -> 'Tfoot :> a+tfoot_A :: ('Tfoot ?> a) => Attribute -> a -> 'Tfoot :> a tfoot_A = WithAttributes th_ :: ('Th ?> a) => a -> 'Th > a th_ = Child -th_A :: ('Th ?> a) => [Attribute] -> a -> 'Th :> a+th_A :: ('Th ?> a) => Attribute -> a -> 'Th :> a th_A = WithAttributes thead_ :: ('Thead ?> a) => a -> 'Thead > a thead_ = Child -thead_A :: ('Thead ?> a) => [Attribute] -> a -> 'Thead :> a+thead_A :: ('Thead ?> a) => Attribute -> a -> 'Thead :> a thead_A = WithAttributes time_ :: ('Time ?> a) => a -> 'Time > a time_ = Child -time_A :: ('Time ?> a) => [Attribute] -> a -> 'Time :> a+time_A :: ('Time ?> a) => Attribute -> a -> 'Time :> a time_A = WithAttributes title_ :: ('Title ?> a) => a -> 'Title > a title_ = Child -title_A :: ('Title ?> a) => [Attribute] -> a -> 'Title :> a+title_A :: ('Title ?> a) => Attribute -> a -> 'Title :> a title_A = WithAttributes tr_ :: ('Tr ?> a) => a -> 'Tr > a tr_ = Child -tr_A :: ('Tr ?> a) => [Attribute] -> a -> 'Tr :> a+tr_A :: ('Tr ?> a) => Attribute -> a -> 'Tr :> a tr_A = WithAttributes track_ :: 'Track > () track_ = Child () -track_A :: [Attribute] -> 'Track :> ()+track_A :: Attribute -> 'Track :> () track_A = flip WithAttributes () tt_ :: ('Tt ?> a) => a -> 'Tt > a tt_ = Child -tt_A :: ('Tt ?> a) => [Attribute] -> a -> 'Tt :> a+tt_A :: ('Tt ?> a) => Attribute -> a -> 'Tt :> a tt_A = WithAttributes u_ :: ('U ?> a) => a -> 'U > a u_ = Child -u_A :: ('U ?> a) => [Attribute] -> a -> 'U :> a+u_A :: ('U ?> a) => Attribute -> a -> 'U :> a u_A = WithAttributes ul_ :: ('Ul ?> a) => a -> 'Ul > a ul_ = Child -ul_A :: ('Ul ?> a) => [Attribute] -> a -> 'Ul :> a+ul_A :: ('Ul ?> a) => Attribute -> a -> 'Ul :> a ul_A = WithAttributes var_ :: ('Var ?> a) => a -> 'Var > a var_ = Child -var_A :: ('Var ?> a) => [Attribute] -> a -> 'Var :> a+var_A :: ('Var ?> a) => Attribute -> a -> 'Var :> a var_A = WithAttributes video_ :: ('Video ?> a) => a -> 'Video > a video_ = Child -video_A :: ('Video ?> a) => [Attribute] -> a -> 'Video :> a+video_A :: ('Video ?> a) => Attribute -> a -> 'Video :> a video_A = WithAttributes wbr_ :: 'Wbr > () wbr_ = Child () -wbr_A :: [Attribute] -> 'Wbr :> ()+wbr_A :: Attribute -> 'Wbr :> () wbr_A = flip WithAttributes () xmp_ :: ('Xmp ?> a) => a -> 'Xmp > a xmp_ = Child -xmp_A :: ('Xmp ?> a) => [Attribute] -> a -> 'Xmp :> a+xmp_A :: ('Xmp ?> a) => Attribute -> a -> 'Xmp :> a xmp_A = WithAttributes
src/Html/Reify.hs view
@@ -1,4 +1,3 @@-{-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE FlexibleInstances #-}@@ -18,100 +17,94 @@ import GHC.TypeLits import Data.Proxy import Data.Semigroup-import Data.String import qualified Data.Text.Lazy as T+import qualified Data.Text.Lazy.Encoding as T import qualified Data.ByteString.Lazy as B+import qualified Data.ByteString.Builder as B -{-# INLINE render #-}-render :: forall a b. Document a b => a -> b-render x = mconcat $ renderchunks (Tagged x :: Tagged (Symbols a) a ())- <> [unConv (conv (Proxy @ (Last' (Symbols a))))]+{-# INLINE renderBuilder #-}+renderBuilder :: forall a. Document a => a -> B.Builder+renderBuilder x = renderchunks (Tagged x :: Tagged (Symbols a) a ())+ <> unConv (convert (Proxy @ (Last' (Symbols a)))) -- | Render a html document to a String. {-# INLINE renderString #-}-renderString :: Document a String => a -> String-renderString = render+renderString :: Document a => a -> String+renderString = T.unpack . renderText -- | Render a html document to a lazy Text. {-# INLINE renderText #-}-renderText :: Document a T.Text => a -> T.Text-renderText = render+renderText :: Document a => a -> T.Text+renderText = T.decodeUtf8 . renderByteString -- | Render a html document to a lazy ByteString. {-# INLINE renderByteString #-}-renderByteString :: Document a B.ByteString => a -> B.ByteString-renderByteString = render+renderByteString :: Document a => a -> B.ByteString+renderByteString = B.toLazyByteString . renderBuilder -type Document a b =- ( Renderchunks (Tagged (Symbols a) a ()) b+type Document a =+ ( Renderchunks (Tagged (Symbols a) a ()) , KnownSymbol (Last' (Symbols a))- , Conv b- , Monoid b ) -class Renderchunks a b where- renderchunks :: a -> [b]+class Renderchunks a where+ renderchunks :: a -> B.Builder -instance KnownSymbol a => Renderchunks (Tagged prox (Proxy a) nex) b where+instance KnownSymbol a => Renderchunks (Tagged prox (Proxy a) nex) where {-# INLINE renderchunks #-} renderchunks _ = mempty-instance Renderchunks (Tagged prox () nex) b where+instance Renderchunks (Tagged prox () nex) where {-# INLINE renderchunks #-} renderchunks _ = mempty instance {-# OVERLAPPABLE #-} ( Convert val- , Conv u , KnownSymbol (HeadL prox)- ) => Renderchunks (Tagged prox val nex) u where+ ) => Renderchunks (Tagged prox val nex) where {-# INLINE renderchunks #-} renderchunks (Tagged x)- = unConv (conv (Proxy @ (HeadL prox)))- : [unConv (conv x)]+ = unConv (convert (Proxy @ (HeadL prox)))+ <> unConv (convert x) instance ( t ~ Tagged prox b (Close a)- , Renderchunks t u- ) => Renderchunks (Tagged prox (a > b) nex) u where+ , Renderchunks t+ ) => Renderchunks (Tagged prox (a > b) nex) where {-# INLINE renderchunks #-} renderchunks (Tagged ~(Child b)) = renderchunks (Tagged b :: t) instance ( t ~ Tagged (Drop 1 prox) b (Close a)- , Renderchunks t u- , Conv u- , Monoid u- , IsString u+ , Renderchunks t , KnownSymbol (HeadL prox)- ) => Renderchunks (Tagged prox (a :> b) nex) u where+ ) => Renderchunks (Tagged prox (a :> b) nex) where {-# INLINE renderchunks #-}- renderchunks (Tagged (WithAttributes xs b))- = unConv (conv (Proxy @ (HeadL prox)))- : foldMap (unConv . conv . Raw . (\(Attribute x) -> x)) xs- : renderchunks (Tagged b :: t)+ renderchunks (Tagged ~(WithAttributes (Attribute x) b))+ = unConv (convert (Proxy @ (HeadL prox)))+ <> x+ <> renderchunks (Tagged b :: t) instance ( t1 ~ Tagged (Take (CountContent a) prox) a b , t2 ~ Tagged (Drop (CountContent a) prox) b nex- , Renderchunks t1 u- , Renderchunks t2 u- , Monoid u- ) => Renderchunks (Tagged prox (a # b) nex) u where+ , Renderchunks t1+ , Renderchunks t2+ ) => Renderchunks (Tagged prox (a # b) nex) where {-# INLINE renderchunks #-} renderchunks (Tagged ~(a :#: b))- = mconcat (renderchunks (Tagged a :: t1)) : renderchunks (Tagged b :: t2)+ = renderchunks (Tagged a :: t1) <> renderchunks (Tagged b :: t2) instance ( t1 ~ Tagged t2 (a `f` b) () , t2 ~ Symbols (Next (a `f` b) nex)- , Renderchunks t1 u- , Conv u+ , Renderchunks t1 , KnownSymbol (Last' t2) , KnownSymbol (HeadL prox)- ) => Renderchunks (Tagged prox [a `f` b] nex) u where+ ) => Renderchunks (Tagged prox [a `f` b] nex) where {-# INLINE renderchunks #-} renderchunks (Tagged xs)- = unConv (conv (Proxy @ (HeadL prox)))- : Prelude.concatMap (\x -> renderchunks (Tagged x :: t1) <> [closing]) xs- where closing = unConv (conv (Proxy @ (Last' t2)))+ = unConv (convert (Proxy @ (HeadL prox)))+ <> foldMap (\x -> renderchunks (Tagged x :: t1) <> closing) xs+ where closing = unConv (convert (Proxy @ (Last' t2)))+ {-# INLINE closing #-}
src/Html/Type.hs view
@@ -1,19 +1,22 @@ {-# OPTIONS_GHC -fno-warn-unticked-promoted-constructors #-} -{-# LANGUAGE UndecidableInstances #-}-{-# LANGUAGE TypeOperators #-}-{-# LANGUAGE TypeFamilies #-}-{-# LANGUAGE DataKinds #-}-{-# LANGUAGE GADTs #-}+{-# LANGUAGE GeneralizedNewtypeDeriving #-}+{-# LANGUAGE UndecidableInstances #-}+{-# LANGUAGE TypeOperators #-}+{-# LANGUAGE TypeFamilies #-}+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE GADTs #-} module Html.Type where -import qualified Data.Text.Lazy as T+import qualified Data.ByteString.Builder as B import GHC.TypeLits import GHC.Exts import Data.Proxy import Data.Type.Bool+import qualified Data.Semigroup as S+import qualified Data.Monoid as M {-# DEPRECATED @@ -251,7 +254,7 @@ -- >>> WithAttributes [A.class_ "bar"] "a" :: 'Div :> String -- <div class="bar">a</div> data (:>) (a :: Element) b where- WithAttributes :: (a ?> b) => [Attribute] -> b -> a :> b+ WithAttributes :: (a ?> b) => Attribute -> b -> a :> b infixr 8 :> -- | Wrapper for types which won't be escaped.@@ -263,7 +266,7 @@ -- internal code -- ------------------- -newtype Attribute = Attribute T.Text+newtype Attribute = Attribute B.Builder deriving (M.Monoid, S.Semigroup) type family ShowElement e where ShowElement DOCTYPE = "!DOCTYPE html"
test/Main.hs view
@@ -217,72 +217,78 @@ shouldBe "<div>a ä € 𝄞</div>" - allT (img_A [A.id_ "a ä € 𝄞"])+ allT (img_A (A.id_ "a ä € 𝄞")) shouldBe "<img id=\"a ä € 𝄞\">" it "computes its result lazily (String)" $ do - renderString (errorWithoutStackTrace "not lazy" :: 'Img > ())+ pending++ renderString (errorWithoutStackTrace "1) not lazy" :: 'Img > ()) `shouldBe` "<img>" - take 5 (renderString (div_ (errorWithoutStackTrace "not lazy" :: String)))+ take 5 (renderString (div_ (errorWithoutStackTrace "2) not lazy" :: String))) `shouldBe` "<div>" - take 5 (renderString (errorWithoutStackTrace "not lazy" :: 'Div > String))+ take 5 (renderString (errorWithoutStackTrace "3) not lazy" :: 'Div > String)) `shouldBe` "<div>" - take 12 (renderString (div_ "a" # (errorWithoutStackTrace "not lazy" :: String)))+ take 12 (renderString (div_ "a" # (errorWithoutStackTrace "4) not lazy" :: String))) `shouldBe` "<div>a</div>" - take 17 (renderString (div_ "a" # [img_ # (errorWithoutStackTrace "not lazy" :: String)]))+ take 17 (renderString (div_ "a" # [img_ # (errorWithoutStackTrace "5) not lazy" :: String)])) `shouldBe` "<div>a</div><img>" it "computes its result lazily (Text)" $ do - T.unpack (renderText (errorWithoutStackTrace "not lazy" :: 'Img > ()))+ pending+ + T.unpack (renderText (errorWithoutStackTrace "1) not lazy" :: 'Img > ())) `shouldBe` "<img>" - take 5 (T.unpack (renderText (div_ (errorWithoutStackTrace "not lazy" :: String))))+ take 5 (T.unpack (renderText (div_ (errorWithoutStackTrace "2) not lazy" :: String)))) `shouldBe` "<div>" - take 5 (T.unpack (renderText (errorWithoutStackTrace "not lazy" :: 'Div > String)))+ take 5 (T.unpack (renderText (errorWithoutStackTrace "3) not lazy" :: 'Div > String))) `shouldBe` "<div>" - take 12 (T.unpack (renderText (div_ "a" # (errorWithoutStackTrace "not lazy" :: String))))+ take 12 (T.unpack (renderText (div_ "a" # (errorWithoutStackTrace "4) not lazy" :: String)))) `shouldBe` "<div>a</div>" - take 17 (T.unpack (renderText (div_ "a" # [img_ # (errorWithoutStackTrace "not lazy" :: String)])))+ take 17 (T.unpack (renderText (div_ "a" # [img_ # (errorWithoutStackTrace "5) not lazy" :: String)]))) `shouldBe` "<div>a</div><img>" it "computes its result lazily (ByteString)" $ do - T.unpack (decodeUtf8 (renderByteString (errorWithoutStackTrace "not lazy" :: 'Img > ())))+ pending++ T.unpack (decodeUtf8 (renderByteString (errorWithoutStackTrace "1) not lazy" :: 'Img > ()))) `shouldBe` "<img>" - take 5 (T.unpack (decodeUtf8 (renderByteString (div_ (errorWithoutStackTrace "not lazy" :: String)))))+ take 5 (T.unpack (decodeUtf8 (renderByteString (div_ (errorWithoutStackTrace "2) not lazy" :: String))))) `shouldBe` "<div>" - take 5 (T.unpack (decodeUtf8 (renderByteString (errorWithoutStackTrace "not lazy" :: 'Div > String))))+ take 5 (T.unpack (decodeUtf8 (renderByteString (errorWithoutStackTrace "3) not lazy" :: 'Div > String)))) `shouldBe` "<div>" - take 12 (T.unpack (decodeUtf8 (renderByteString (div_ "a" # (errorWithoutStackTrace "not lazy" :: String)))))+ take 12 (T.unpack (decodeUtf8 (renderByteString (div_ "a" # (errorWithoutStackTrace "4) not lazy" :: String))))) `shouldBe` "<div>a</div>" - take 17 (T.unpack (decodeUtf8 (renderByteString (div_ "a" # [img_ # (errorWithoutStackTrace "not lazy" :: String)]))))+ take 17 (T.unpack (decodeUtf8 (renderByteString (div_ "a" # [img_ # (errorWithoutStackTrace "5) not lazy" :: String)])))) `shouldBe` "<div>a</div><img>"
type-of-html.cabal view
@@ -1,5 +1,5 @@ name: type-of-html-version: 0.3.0.0+version: 0.4.0.0 synopsis: High performance type driven html generation. description: This library makes most invalid html documents compile time errors and uses advanced type level features to realise compile time computations. license: BSD3@@ -31,6 +31,7 @@ build-depends: base >= 4.10 && < 4.11 , text , bytestring+ , ghc-prim test-suite test type: exitcode-stdio-1.0