plzwrk 0.0.0.3 → 0.0.0.4
raw patch · 15 files changed
+3447/−3215 lines, 15 filesdep +hashabledep +haskell-src-metadep +parsec
Dependencies added: hashable, haskell-src-meta, parsec, split, template-haskell
Files
- ChangeLog.md +4/−0
- README.md +24/−9
- hello-world/Main.hs +7/−5
- kitchen-sink/Main.hs +23/−19
- plzwrk.cabal +127/−118
- src/Web/Framework/Plzwrk.hs +10/−22
- src/Web/Framework/Plzwrk/Base.hs +57/−67
- src/Web/Framework/Plzwrk/Domify.hs +524/−483
- src/Web/Framework/Plzwrk/TH/HSX.hs +120/−0
- src/Web/Framework/Plzwrk/TH/QuoteHSX.hs +95/−0
- src/Web/Framework/Plzwrk/Tag.hs +2277/−2277
- src/Web/Framework/Plzwrk/Util.hs +9/−107
- test/DOMSpec.hs +110/−0
- test/HSXSpec.hs +56/−0
- test/Spec.hs +4/−108
ChangeLog.md view
@@ -1,5 +1,9 @@ # Changelog for plzwrk +## 0.0.0.4++- Adds `hsx` and `hsx'` for `jsx`-like manipulation.+ ## 0.0.0.3 - Adds bindings for `fetch`
README.md view
@@ -5,14 +5,15 @@ ## Hello world ```haskell -import Web.Framework.Plzwrk -import Web.Framework.Plzwrk.Asterius -import Web.Framework.Plzwrk.Tag (p__) +{-# LANGUAGE QuasiQuotes #-} +import Web.Framework.Plzwrk +import Web.Framework.Plzwrk.Asterius + main :: IO () main = do browser <- asteriusBrowser - plzwrk'_ (p__ "Hello world!") browser + plzwrk'_ [hsx|<p>Hello world!</p>|] browser ``` See it [live](https://plzwrk-hello-world.surge.sh). @@ -33,7 +34,7 @@ `plzwrk` uses [Asterius](https://github.com/tweag/asterius) as its backend for web development. Compiling an application using `plzwrk` is no different than compiling an application using `ahc-cabal` and `ahc-dist` as described in the [Asterius documentation](https://asterius.netlify.app) with **one caveat**. You **must** use `--constraint "plzwrk +plzwrk-enable-asterius"` when running `ahc-cabal`. -A minimal flow is shown below, mostly copied from the asterius documentation. It assumes that you have a cabal-buildable project in the root directory. Note the use of the `--constraint "plzwrk +plzwrk-enable-asterius"` flag in the `ahc-cabal` step. +A minimal flow is shown below, mostly copied from the asterius documentation. It assumes that you have a cabal-buildable project in the `pwd`. Note the use of the `--constraint "plzwrk +plzwrk-enable-asterius"` flag in the `ahc-cabal` step. ```bash username@hostname:~/my-dir$ docker run --rm -it -v $(pwd):/project -w /project terrorjack/asterius @@ -47,13 +48,13 @@ The main documentation for `plzwrk` is on [hackage](https://hackage.haskell.org/package/plzwrk). The four importable modules are: - `Web.Frameworks.Plzwrk` for the basic functions -- `Web.Frameworks.Plzwrk.Tag` for helper functions to make takes like `input` or `br`. +- `Web.Frameworks.Plzwrk.Tag` for helper functions to make takes like `input` or `br` if you are not using `hsx`. - `Web.Frameworks.Plzwrk.MockJSVal` to use a mock browser. - `Web.Frameworks.Plzwrk.Asterius` to use a bindings for a real browser courtesy of [Asterius](https://github.com/tweag/asterius). ## Design -`plzwrk` is inspired by [redux](https://redux.js.org/) for its state management. The main idea is that you have a HTML-creation function that accepts one or more variables from a state that is composed, via applicative functors, with getters from a state. +`plzwrk` is inspired by [redux](https://redux.js.org/) for its state management. The main idea is that you have a HTML-creation function that is composed, via `<*>`, with getters from a state. ```haskell @@ -61,6 +62,9 @@ data MyState = MkMyState { _name :: Text, age :: Int, _tags :: [Text] } -- Function hydrating a DOM with elementse from the state +makeP = (\name age -> [hsx'|<p>#t{concat [name, " is the name and ", show age, " is my age."]}#</p>|] <$> _name <*> _age + +-- The same function using functional tags instead of hsx makeP = (\name age -> p'__ concat [name, " is the name and ", show age, " is my age."]) <$> _name <*> _age ``` @@ -70,15 +74,26 @@ nested = div_ (take 10 $ repeat makeP) ``` -HTML-creation functions use an apostrophe after the tag name (ie `div'`) if they accept arguments and no apostrophe (ie `div`) if they don't. Additionally, tags that do not have any attributes (class, style etc) are marked with a trailing underscore (`div_ [p__ "hello"]`), and tags that only accept text are marked with two trailing underscores (`p__ "hello"`). +### HSX -The HTML-creation function itself should be pure with type `(s -> Node s opq)`, where `s` is the type of the state and `opq` is the type of the opaque pointer used to represent a JavaScript value. `opq` will rarely need to be provided manually as it is induced from the compiler based on the `Browserful` being used (ie `asteriusBrowser`). +`hsx` is not unlike `jsx`. The main difference is that instead of using just `{}`, `hsx` uses three different varieties of `#{}#` +- `#e{}#` for an element +- `#t{}#` for a text node or text attribute +- `#c{}#` for a callback attribute + +### Hydrating with a state + +HTML-creation functions use an apostrophe after the tag name (ie `div'`) if they accept arguments from a state and no apostrophe (ie `div`) if they don't. The same is true of `hsx`, ie `[hsx|<br />|]` versus `(s -> [hsx'|<br />|])`. Additionally, HTML-creation functions for tags that do not have any attributes (class, style etc) are marked with a trailing underscore (`div_ [p__ "hello"]`), and tags that only accept text are marked with two trailing underscores (`p__ "hello"`). + +### Event handlers + Event handlers take two arguments - an opaque pointer to the event and the current state - and return a new state (which could just be the original state) in the `IO` monad. For example, if the state is an integer, a valid event handler could be: ``` eh :: opq -> Int -> IO Int eh _ i = pure $ i + 1 +dom = [hsx|<button click=#c{eh}#>Click here</button>|] ``` To handle events (ie extract values from input events, etc) you can use one of the functions exported by `Web.Framework.Plzwrk`. Please see the [hackage documentation](https://hackage.haskell.org/package/plzwrk) for more information.
hello-world/Main.hs view
@@ -1,17 +1,19 @@ {-# LANGUAGE CPP #-} +{-# LANGUAGE QuasiQuotes #-} import Web.Framework.Plzwrk #if defined(PLZWRK_ENABLE_ASTERIUS) import Web.Framework.Plzwrk.Asterius import Web.Framework.Plzwrk.Tag (p__) +#else +import Web.Framework.Plzwrk.MockJSVal +#endif main :: IO () main = do +#if defined(PLZWRK_ENABLE_ASTERIUS) browser <- asteriusBrowser - plzwrk'_ (p__ "Hello world!") browser - - # else -main :: IO () -main = print "If you're using ahc, please set -DPLZWRK_ENABLE_ASTERIUS as a flag to run this executable." + browser <- makeMockBrowser # endif + plzwrk'_ [hsx|<p>Hello world!</p>|] browser
kitchen-sink/Main.hs view
@@ -1,10 +1,14 @@ {-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-} -#if defined(PLZWRK_ENABLE_ASTERIUS) {-# LANGUAGE QuasiQuotes #-} - +#if defined(PLZWRK_ENABLE_ASTERIUS) import Asterius.Types +import Web.Framework.Plzwrk.Asterius +# else +import Web.Framework.Plzwrk.MockJSVal +# endif + import Control.Monad import Data.HashMap.Strict hiding ( null ) import Data.IORef @@ -16,7 +20,6 @@ , span ) import Web.Framework.Plzwrk -import Web.Framework.Plzwrk.Asterius import Web.Framework.Plzwrk.Tag hiding ( main , main_ @@ -44,17 +47,17 @@ -- here is where we will input a noun for our "surprise" aphorosim writeSomethingConcrete browser = input - (wAttr "type" "text" <.> wStyle "box-sizing" "content-box" <.> wOnInput - (\e s -> do + [("type", pT "text"), ("style", pT "box-sizing:content-box"), ("input", + pF (\e s -> do v <- (eventTargetValue browser) e return $ maybe s (\q -> s { _myNoun = q }) v ) - ) + )] [] aphorismList = (\a2c -> ul' - (wClass "res") + [("class", pT "res")] (fmap (\(a, c) -> (li__ (concat [a, " is like", indefiniteArticle c, c]))) a2c ) @@ -63,8 +66,8 @@ addAphorismButton browser = (\a2c -> button' - (wId "incr" <.> wClass "dim" <.> wOnClick - (\e s -> do + [("id", pT "incr"), ("class", pT "dim"), ("click", + pF (\e s -> do (eventTargetBlur browser) e (consoleLogS browser) $ "Here is the current state " <> show s concept <- randAbstract (mathRandom browser) @@ -73,30 +76,35 @@ (consoleLogS browser) $ "Here is the new state " <> show newS return $ newS ) - ) + )] [txt "More aphorisms"] ) <$> _abstractToConcrete removeAphorismButton browser = (\a2c -> button' - (wId "decr" <.> wClass "dim" <.> wOnClick + [("id", pT "decr"), ("class", pT "dim"), ("click", pF (\e s -> do (eventTargetBlur browser) e pure $ s { _abstractToConcrete = if null a2c then [] else tail a2c } ) - ) + )] [txt "Less aphorisms"] ) <$> _abstractToConcrete loginText = - (\name -> p'_ [txt "Logged in as: ", span (wClass "username") [txt name]]) + (\name -> p'_ [txt "Logged in as: ", span [("class", pT "username")] [txt name]]) <$> _name main :: IO () main = do + +#if defined(PLZWRK_ENABLE_ASTERIUS) browser <- asteriusBrowser +# else + browser <- makeMockBrowser +# endif -- add some css! _head <- (documentHead browser) _style <- (documentCreateElement browser) "style" @@ -106,12 +114,12 @@ -- and here is our main div let mainDivF = T.main_ [ section - (wClass "content") + [("class", pT "content")] [ h1__ "Aphorism Machine" , aphorismList , br , surprise - , div (wStyles [("width", "100%"), ("display", "inline-block")]) + , div [("style", pT "width:100%;display:inline-block")] [addAphorismButton browser, removeAphorismButton browser] , writeSomethingConcrete browser , loginText @@ -332,7 +340,3 @@ } |] -# else -main :: IO () -main = print "If you're using ahc, please set -DPLZWRK_ENABLE_ASTERIUS as a flag to run this executable." -# endif
plzwrk.cabal view
@@ -1,118 +1,127 @@-cabal-version: 1.12---- This file has been generated from package.yaml by hpack version 0.31.2.------ see: https://github.com/sol/hpack------ hash: 8099ceb0d406f862d89306de053aba4c75999a9e0d74ac6a502458d503e7dcc1--name: plzwrk-version: 0.0.0.3-category: Web-synopsis: A front-end framework-description: Please see the README on GitHub at <https://github.com/meeshkan/plzwrk#readme>-homepage: https://github.com/meeshkan/plzwrk#readme-bug-reports: https://github.com/meeshkan/plzwrk/issues-author: Mike Solomon-maintainer: mike@meeshkan.com-copyright: 2020 Mike Solomon-license: BSD3-license-file: LICENSE-build-type: Simple-extra-source-files:- README.md- ChangeLog.md--source-repository head- type: git- location: https://github.com/meeshkan/plzwrk--flag plzwrk-enable-asterius- Description: Enable asterius- Default: False- Manual: True--library- exposed-modules:- Web.Framework.Plzwrk- , Web.Framework.Plzwrk.Asterius- , Web.Framework.Plzwrk.MockJSVal- , Web.Framework.Plzwrk.Tag- other-modules:- Paths_plzwrk- , Web.Framework.Plzwrk.Base- , Web.Framework.Plzwrk.Browserful- , Web.Framework.Plzwrk.Domify- , Web.Framework.Plzwrk.Util- hs-source-dirs:- src- build-depends:- base >=4.7 && <5- , aeson >= 1.4.7 && < 1.5- , bytestring >= 0.10.10 && < 0.11- , containers >= 0.6.2 && < 0.7- , mtl >= 2.2.2 && < 2.3- , random >= 1.1 && < 1.2- , text >= 1.2.3 && < 1.3- , transformers >= 0.5.6 && < 0.6- , unordered-containers >= 0.2.10 && < 0.3- default-language: Haskell2010- if flag(plzwrk-enable-asterius)- cpp-options:- -DPLZWRK_ENABLE_ASTERIUS- build-depends:- asterius-prelude--executable kitchen-sink-exe- main-is: Main.hs- other-modules:- Nouns- , Paths_plzwrk- hs-source-dirs:- kitchen-sink- ghc-options: -rtsopts -with-rtsopts=-N- build-depends:- base >=4.7 && <5- , plzwrk- , containers >= 0.6.2 && < 0.7- , neat-interpolation >= 0.5.1 && < 0.6- , text >= 1.2.3 && < 1.3- , unordered-containers >= 0.2.10 && < 0.3- - default-language: Haskell2010- if flag(plzwrk-enable-asterius)- cpp-options:- -DPLZWRK_ENABLE_ASTERIUS--executable hello-world-exe- main-is: Main.hs- other-modules:- Paths_plzwrk- hs-source-dirs:- hello-world- ghc-options: -rtsopts -with-rtsopts=-N- build-depends:- base >=4.7 && <5- , plzwrk- , text >= 1.2.3 && < 1.3- default-language: Haskell2010- if flag(plzwrk-enable-asterius)- cpp-options:- -DPLZWRK_ENABLE_ASTERIUS--test-suite plzwrk-test- type: exitcode-stdio-1.0- main-is: Spec.hs- other-modules:- Paths_plzwrk- hs-source-dirs:- test- ghc-options: -threaded -rtsopts -with-rtsopts=-N- build-depends:- base >=4.7 && <5- , hspec >=2.7.0 && <2.7.2- , mtl >=2.2.2 && <2.3- , plzwrk- , text >=1.2.3 && <1.3- , unordered-containers >=0.2.10 && <0.3- default-language: Haskell2010+cabal-version: 1.12 + +-- This file has been generated from package.yaml by hpack version 0.31.2. +-- +-- see: https://github.com/sol/hpack +-- +-- hash: 8099ceb0d406f862d89306de053aba4c75999a9e0d74ac6a502458d503e7dcc1 + +name: plzwrk +version: 0.0.0.4 +category: Web +synopsis: A front-end framework +description: Please see the README on GitHub at <https://github.com/meeshkan/plzwrk#readme> +homepage: https://github.com/meeshkan/plzwrk#readme +bug-reports: https://github.com/meeshkan/plzwrk/issues +author: Mike Solomon +maintainer: mike@meeshkan.com +copyright: 2020 Mike Solomon +license: BSD3 +license-file: LICENSE +build-type: Simple +extra-source-files: + README.md + ChangeLog.md + +source-repository head + type: git + location: https://github.com/meeshkan/plzwrk + +flag plzwrk-enable-asterius + Description: Enable asterius + Default: False + Manual: True + +library + exposed-modules: + Web.Framework.Plzwrk + , Web.Framework.Plzwrk.Asterius + , Web.Framework.Plzwrk.MockJSVal + , Web.Framework.Plzwrk.Tag + other-modules: + Paths_plzwrk + , Web.Framework.Plzwrk.Base + , Web.Framework.Plzwrk.Browserful + , Web.Framework.Plzwrk.Domify + , Web.Framework.Plzwrk.Util + , Web.Framework.Plzwrk.TH.HSX + , Web.Framework.Plzwrk.TH.QuoteHSX + hs-source-dirs: + src + build-depends: + base >=4.7 && <5 + , aeson >= 1.4.7 && < 1.5 + , bytestring >= 0.10.10 && < 0.11 + , containers >= 0.6.2 && < 0.7 + , hashable + , haskell-src-meta + , mtl >= 2.2.2 && < 2.3 + , parsec + , random >= 1.1 && < 1.2 + , split + , template-haskell + , text >= 1.2.3 && < 1.3 + , transformers >= 0.5.6 && < 0.6 + , unordered-containers >= 0.2.10 && < 0.3 + default-language: Haskell2010 + if flag(plzwrk-enable-asterius) + cpp-options: + -DPLZWRK_ENABLE_ASTERIUS + build-depends: + asterius-prelude + +executable kitchen-sink-exe + main-is: Main.hs + other-modules: + Nouns + , Paths_plzwrk + hs-source-dirs: + kitchen-sink + ghc-options: -rtsopts -with-rtsopts=-N + build-depends: + base >=4.7 && <5 + , plzwrk + , containers >= 0.6.2 && < 0.7 + , neat-interpolation >= 0.5.1 && < 0.6 + , text >= 1.2.3 && < 1.3 + , unordered-containers >= 0.2.10 && < 0.3 + + default-language: Haskell2010 + if flag(plzwrk-enable-asterius) + cpp-options: + -DPLZWRK_ENABLE_ASTERIUS + +executable hello-world-exe + main-is: Main.hs + other-modules: + Paths_plzwrk + hs-source-dirs: + hello-world + ghc-options: -rtsopts -with-rtsopts=-N + build-depends: + base >=4.7 && <5 + , plzwrk + , text >= 1.2.3 && < 1.3 + default-language: Haskell2010 + if flag(plzwrk-enable-asterius) + cpp-options: + -DPLZWRK_ENABLE_ASTERIUS + +test-suite plzwrk-test + type: exitcode-stdio-1.0 + main-is: Spec.hs + other-modules: + DOMSpec + , HSXSpec + , Paths_plzwrk + hs-source-dirs: + test + ghc-options: -threaded -rtsopts -with-rtsopts=-N + build-depends: + base >=4.7 && <5 + , hspec >=2.7.0 && <2.7.2 + , mtl >=2.2.2 && <2.3 + , plzwrk + , text >=1.2.3 && <1.3 + , unordered-containers >=0.2.10 && <0.3 + default-language: Haskell2010
src/Web/Framework/Plzwrk.hs view
@@ -19,29 +19,16 @@ , plzwrk'_ , plzwrkSSR , toHTML - , Node(..) - , Attributes(..) + , PwNode(..) + , PwAttribute(..) , Browserful(..) + -- hsx + , hsx + , hsx' + , hmFromList -- util - , (<.>) - , wStyle - , wStyle' - , wStyles - , wStyles' - , wClass - , wClass' - , wClasses - , wClasses' - , wOnClick - , wOnClick' - , wId - , wId' - , wOnInput - , wOnInput' - , wAttr - , wAttr' - , wAttrs - , wAttrs' + , pF + , pT , eventPreventDefault , eventTargetBlur , eventTargetValue @@ -69,4 +56,5 @@ import Web.Framework.Plzwrk.Base import Web.Framework.Plzwrk.Browserful import Web.Framework.Plzwrk.Domify -import Web.Framework.Plzwrk.Util+import Web.Framework.Plzwrk.Util +import Web.Framework.Plzwrk.TH.QuoteHSX
src/Web/Framework/Plzwrk/Base.hs view
@@ -2,9 +2,9 @@ ( hydrate , dats , dats'- , Node(..)- , HydratedNode(..)- , Attributes(..)+ , PwNode(..)+ , HydratedPwNode(..)+ , PwAttribute(..) , cssToStyle , toHTML )@@ -20,95 +20,82 @@ (intercalate ";" $ fmap (\(x, y) -> x <> ":" <> y) (HM.toList css)) --- |Attributes for a DOM Node.--- Attributes are parameterized by two types+-- |PwAttribute for a DOM PwNode.++-- PwAttribute are parameterized by two types+ -- * @s@ - the type of the state+ -- * @opq@ - the type of an opaque object in JavaScript+ ----- You will rarely need to instantiate @Attributes@ yourself,++-- You will rarely need to instantiate @PwAttribute@ yourself,+ -- as it is easier to work with utility functions like 'wId',+ -- 'wStyle' etc that produce Applicative Functors with signature--- @(s -> Attributes s opq)@. These AFs are used in the 'Node' data.-data Attributes s opq = MkAttributes- { _style :: HM.HashMap String String- , _class :: S.Set String- , _simple :: HM.HashMap String String- , _handlers :: HM.HashMap String (opq -> s -> IO s)- } -dats = (\_ -> MkAttributes HM.empty S.empty HM.empty HM.empty)-dats' = MkAttributes HM.empty S.empty HM.empty HM.empty+-- @(s -> PwAttribute s opq)@. These AFs are used in the 'PwNode' data. +data PwAttribute s opq = PwTextAttribute String | PwFunctionAttribute (opq -> s -> IO s) -instance Show (Attributes s opq) where- show (MkAttributes __style __class __simple _) =- "Attributes ("- <> show __style- <> ", "- <> show __class- <> ", "- <> show __simple- <> ")"+dats = []+dats' = [] +instance Show (PwAttribute s opq) where+ show (PwTextAttribute t) = "PwTextAttribute (" <> t <> ")"+ show (PwFunctionAttribute t) = "PwFunctionAttribute"+ -- |A DOM node. -- The easiest way to create nodes is using tags such as -- 'Web.Framework.Plzwrk.Util.span' or 'Web.Framework.Plzwrk.br'.--- Nodes can be created for arbitrary tags using the 'Element'+-- PwNodes can be created for arbitrary tags using the 'PwElement' -- constructor. ----- Node is parameterized by two types+-- PwNode is parameterized by two types -- * @s@ - the type of the state -- * @opq@ - the type of an opaque object in JavaScript -- -- Note that nodes, when passed as an arguemnt to 'plzwrk', need--- to be Applicative Functors in the form @(s -> Node s opq)@.-data Node s opq = Element+-- to be Applicative Functors in the form @(s -> PwNode s opq)@.++data PwNode s opq = PwElement { _elt_tag :: String- , _elt_attrs :: (s -> Attributes s opq)- , _elt_children :: [s -> Node s opq]- } | TextNode { _tn_text :: String }+ , _elt_attrs :: [(String, (s -> PwAttribute s opq))]+ , _elt_children :: [s -> PwNode s opq]+ } | PwTextNode { _tn_text :: String } -instance Show (Node s opq) where- show (Element t _ _) = show t- show (TextNode t ) = show t+instance Show (PwNode s opq) where+ show (PwElement t _ _) = show t+ show (PwTextNode t ) = show t -data HydratedNode s opq = HydratedElement+data HydratedPwNode s opq = HydratedPwElement { _hy_tag :: String- , _hy_attr :: (Attributes s opq)- , _hy_kids :: [HydratedNode s opq]+ , _hy_attr :: [(String, PwAttribute s opq)]+ , _hy_kids :: [HydratedPwNode s opq] }- | HydratedTextNode String+ | HydratedPwTextNode String deriving (Show) -_hydrate :: s -> Node s opq -> HydratedNode s opq-_hydrate s (Element a b c) =- HydratedElement a (b s) (fmap (\x -> hydrate s x) c)-_hydrate s (TextNode t) = HydratedTextNode t+_hydrate :: s -> PwNode s opq -> HydratedPwNode s opq+_hydrate s (PwElement a b c) =+ HydratedPwElement a (fmap (\(x, y) -> (x, y s)) b) (fmap (\x -> hydrate s x) c)+_hydrate s (PwTextNode t) = HydratedPwTextNode t -hydrate :: s -> (s -> Node s opq) -> HydratedNode s opq+hydrate :: s -> (s -> PwNode s opq) -> HydratedPwNode s opq hydrate s f = _hydrate s (f s) -stringifyAttributes :: Attributes state jsval -> String-stringifyAttributes (MkAttributes __style __class __simple _) =- intercalate " " $ filter- (not . null)- [ (if (HM.null __style)- then ""- else "style=\"" ++ cssToStyle __style ++ "\""- )- , (if (S.null __class)- then ""- else "class=\"" ++ unwords (S.toList __class) ++ "\""- )- , (if (HM.null __simple)- then ""- else intercalate " "- $ fmap (\(x, y) -> x ++ "=\"" ++ y ++ "\"") (HM.toList __simple)- )- ]+stringifyPwAttribute :: PwAttribute state jsval -> String+stringifyPwAttribute (PwTextAttribute t) = t+stringifyPwAttribute (PwFunctionAttribute _) = "" -_toHTML :: HydratedNode state jsval -> String-_toHTML (HydratedElement tag attrs ch) =+isText :: PwAttribute state jsval -> Bool+isText (PwTextAttribute _) = True+isText _ = False++_toHTML :: HydratedPwNode state jsval -> String+_toHTML (HydratedPwElement tag attrs ch) = "<" ++ tag ++ (if (null atts) then "" else " " ++ atts)@@ -116,12 +103,15 @@ then "/>" else ">" ++ (concat $ fmap _toHTML ch) ++ "</" ++ tag ++ ">" )- where atts = stringifyAttributes attrs-_toHTML (HydratedTextNode txt) = txt+ where+ atts = intercalate " " $ fmap+ (\(x, y) -> x <> "=\"" <> stringifyPwAttribute y <> "\"")+ (filter (isText . snd) attrs)+_toHTML (HydratedPwTextNode txt) = txt --- |Converts a Node to HTML.+-- |Converts a PwNode to HTML. toHTML- :: (state -> Node state jsval) -- ^ A function that takes a state and produces a DOM+ :: (state -> PwNode state jsval) -- ^ A function that takes a state and produces a DOM -> state -- ^ An initial state -> String -- ^ The resulting HTML toHTML domF state = _toHTML (hydrate state domF)
src/Web/Framework/Plzwrk/Domify.hs view
@@ -1,483 +1,524 @@-module Web.Framework.Plzwrk.Domify - ( plzwrk - , plzwrk' - , plzwrk'_ - , plzwrkSSR - , plzwrkSSR' - , plzwrkSSR'_ - ) -where - -import Control.Applicative -import Control.Monad -import Control.Monad.Reader -import Control.Monad.Trans -import Control.Monad.Trans.Maybe -import qualified Data.HashMap.Strict as HM -import Data.IORef -import Data.Maybe ( catMaybes ) -import qualified Data.Set as S -import Web.Framework.Plzwrk.Base -import Web.Framework.Plzwrk.Browserful -import Web.Framework.Plzwrk.Util - -data DomifiedAttributes jsval = MkDomifiedAttributes - { _d_style :: HM.HashMap String String - , _d_class :: S.Set String - , _d_simple :: HM.HashMap String String - , _d_handlers :: HM.HashMap String jsval - } - -data DomifiedNode jsval = DomifiedElement - { _dom_tag :: String - , _dom_attr :: (DomifiedAttributes jsval) - , _dom_kids :: [DomifiedNode jsval] - , _dom_ptr :: jsval - } - | DomifiedTextNode String jsval - -data OldStuff state jsval = OldStuff { - _oldState :: state, - _oldDom :: Maybe (DomifiedNode jsval) -} - ----------- reader functions - - - - -freeAttrFunctions - :: DomifiedAttributes jsval -> ReaderT (Browserful jsval) IO () -freeAttrFunctions (MkDomifiedAttributes _ _ _ __d_handlers) = do - __freeCallback <- asks _freeCallback - liftIO $ void (mapM __freeCallback (HM.elems __d_handlers)) - -freeFunctions :: DomifiedNode jsval -> ReaderT (Browserful jsval) IO () -freeFunctions (DomifiedElement _ b c _) = do - freeAttrFunctions b - mapM_ freeFunctions c -freeFunctions _ = pure () - -nodesEq - :: String - -> String - -> DomifiedAttributes jsval - -> Attributes state jsval - -> Bool -nodesEq t0 t1 (MkDomifiedAttributes __d_style __d_class __d_simple _) (MkAttributes __style __class __simple _) - = (t0 == t1) - && (__d_style == __style) - && (__d_class == __class) - && (__d_simple == __simple) - -padr :: Int -> a -> [a] -> [a] -padr i v l = if (length l >= i) then l else padr i v (l ++ [v]) - -reconcile - :: Bool - -> IORef (OldStuff state jsval) - -> (state -> Node state jsval) - -> jsval - -> jsval - -> Maybe (DomifiedNode jsval) - -> Maybe (HydratedNode state jsval) - -> ReaderT - (Browserful jsval) - IO - (Maybe (DomifiedNode jsval)) -reconcile touchDOM refToOldStuff domCreationF parentNode topLevelNode (Just (DomifiedElement currentTag currentAttributes currentChildren currentNode)) (Just maybeNewNode@(HydratedElement maybeNewTag maybeNewAttributes maybeNewChildren)) - = if (nodesEq currentTag maybeNewTag currentAttributes maybeNewAttributes) - then - (do - let maxlen = max (length maybeNewChildren) (length currentChildren) - newChildren <- sequence $ getZipList - ( (reconcile touchDOM - refToOldStuff - domCreationF - currentNode - topLevelNode - ) - <$> (ZipList (padr maxlen Nothing (fmap Just currentChildren))) - <*> (ZipList (padr maxlen Nothing (fmap Just maybeNewChildren))) - ) - currentAttributes <- hydratedAttrsToDomifiedAttrs refToOldStuff - domCreationF - parentNode - maybeNewAttributes - if touchDOM - then - (do - removeEventHandlers currentNode currentAttributes - setEventHandlers currentNode currentAttributes - ) - else (pure ()) - return $ Just - (DomifiedElement currentTag - currentAttributes - (catMaybes newChildren) - currentNode - ) - ) - else - (do - res <- domify touchDOM - refToOldStuff - domCreationF - parentNode - topLevelNode - (Just currentNode) - maybeNewNode - return $ Just res - ) -reconcile touchDOM refToOldStuff domCreationF parentNode topLevelNode (Just currentDomifiedString@(DomifiedTextNode currentString currentNode)) (Just maybeNewNode@(HydratedTextNode maybeNewString)) - = if (currentString == maybeNewString) - then pure (Just currentDomifiedString) - else - (do - res <- domify touchDOM - refToOldStuff - domCreationF - parentNode - topLevelNode - (Just currentNode) - maybeNewNode - return $ Just res - ) -reconcile touchDOM refToOldStuff domCreationF parentNode topLevelNode (Just (DomifiedElement _ _ _ currentNode)) (Just maybeNewNode@(HydratedTextNode _)) - = do - res <- domify touchDOM - refToOldStuff - domCreationF - parentNode - topLevelNode - (Just currentNode) - maybeNewNode - return $ Just res -reconcile touchDOM refToOldStuff domCreationF parentNode topLevelNode (Just (DomifiedTextNode _ currentNode)) (Just maybeNewNode@(HydratedElement _ _ _)) - = do - res <- domify touchDOM - refToOldStuff - domCreationF - parentNode - topLevelNode - (Just currentNode) - maybeNewNode - return $ Just res -reconcile touchDOM refToOldStuff domCreationF parentNode topLevelNode Nothing (Just maybeNewNode) - = do - res <- domify touchDOM - refToOldStuff - domCreationF - parentNode - topLevelNode - Nothing - maybeNewNode - return $ Just res -reconcile touchDOM refToOldStuff domCreationF parentNode _ (Just (DomifiedElement _ _ _ currentNode)) Nothing - = if (touchDOM) - then - (do - _nodeRemoveChild <- asks nodeRemoveChild - liftIO $ _nodeRemoveChild parentNode currentNode - return Nothing - ) - else (pure Nothing) -reconcile touchDOM refToOldStuff domCreationF parentNode _ (Just (DomifiedTextNode _ currentNode)) Nothing - = if (touchDOM) - then - (do - _nodeRemoveChild <- asks nodeRemoveChild - liftIO $ _nodeRemoveChild parentNode currentNode - return Nothing - ) - else (pure Nothing) -reconcile _ _ _ _ _ _ _ = error "Inconsistent state" - -reconcileAndAdd = reconcile True - -cbMaker - :: IORef (OldStuff state jsval) - -> (state -> Node state jsval) - -> jsval - -> (jsval -> state -> IO state) - -> Browserful jsval - -> jsval - -> IO () -cbMaker refToOldStuff domCreationF topLevelNode eventToState env event = do - oldStuff <- readIORef refToOldStuff - let oldDom = _oldDom oldStuff - let oldState = _oldState oldStuff - newState <- eventToState event oldState - let newHydratedDom = hydrate newState domCreationF - newDom <- runReaderT - (reconcileAndAdd refToOldStuff - domCreationF - topLevelNode - topLevelNode - oldDom - (Just newHydratedDom) - ) - env - maybe (pure ()) (\x -> runReaderT (freeFunctions x) env) oldDom - writeIORef refToOldStuff (OldStuff newState newDom) - -eventable - :: IORef (OldStuff state jsval) - -> (state -> Node state jsval) - -> jsval - -> (jsval -> state -> IO state) - -> ReaderT (Browserful jsval) IO jsval -eventable refToOldStuff domCreationF topLevelNode eventToState = do - __makeHaskellCallback <- asks _makeHaskellCallback - env <- ask - liftIO $ __makeHaskellCallback - (cbMaker refToOldStuff domCreationF topLevelNode eventToState env) - -hydratedAttrsToDomifiedAttrs - :: IORef (OldStuff state jsval) - -> (state -> Node state jsval) - -> jsval - -> Attributes state jsval - -> ReaderT (Browserful jsval) IO (DomifiedAttributes jsval) -hydratedAttrsToDomifiedAttrs refToOldStuff domCreationF topLevelNode (MkAttributes __style __class __simple __handlers) - = do - handlers <- mapM - (\(k, v) -> do - func <- eventable refToOldStuff domCreationF topLevelNode v - return $ (k, func) - ) - (HM.toList __handlers) - return - $ MkDomifiedAttributes __style __class __simple (HM.fromList handlers) - -setAtts :: jsval -> DomifiedAttributes jsval -> ReaderT (Browserful jsval) IO () -setAtts currentNode domifiedAttributes@(MkDomifiedAttributes __style __class __simple _) - = do - _elementSetAttribute <- asks elementSetAttribute - liftIO $ if (HM.null __style) - then (pure ()) - else (_elementSetAttribute currentNode "style") . cssToStyle $ __style - liftIO $ if (S.null __class) - then (pure ()) - else - ((_elementSetAttribute currentNode "class") . unwords . S.toList) - $ __class - liftIO $ mapM_ (\x -> _elementSetAttribute currentNode (fst x) (snd x)) - (HM.toList __simple) - setEventHandlers currentNode domifiedAttributes - -handleOnlyEventListeners - :: (jsval -> String -> jsval -> IO ()) - -> jsval - -> DomifiedAttributes jsval - -> IO () -handleOnlyEventListeners eventListenerHandlerF currentNode domifiedAttributes = - void $ mapM (\(k, v) -> eventListenerHandlerF currentNode k v) - (HM.toList . _d_handlers $ domifiedAttributes) - -setEventHandlers - :: jsval -> DomifiedAttributes jsval -> ReaderT (Browserful jsval) IO () -setEventHandlers currentNode domifiedAttributes = do - _eventTargetAddEventListener <- asks eventTargetAddEventListener - liftIO $ handleOnlyEventListeners _eventTargetAddEventListener - currentNode - domifiedAttributes - -removeEventHandlers - :: jsval -> DomifiedAttributes jsval -> ReaderT (Browserful jsval) IO () -removeEventHandlers currentNode domifiedAttributes = do - _eventTargetRemoveEventListener <- asks eventTargetRemoveEventListener - liftIO $ handleOnlyEventListeners _eventTargetRemoveEventListener - currentNode - domifiedAttributes - -domify - :: Bool - -> IORef (OldStuff state jsval) - -> (state -> Node state jsval) - -> jsval - -> jsval - -> Maybe jsval - -> HydratedNode state jsval - -> ReaderT (Browserful jsval) IO (DomifiedNode jsval) -domify touchDOM refToOldStuff domCreationF parentNode topLevelNode replacing (HydratedElement tag attrs children) - = do - _documentCreateElement <- asks documentCreateElement - _nodeAppendChild <- asks nodeAppendChild - _nodeInsertBefore <- asks nodeInsertBefore - _nodeRemoveChild <- asks nodeRemoveChild - newNode <- liftIO $ _documentCreateElement tag - newAttributes <- hydratedAttrsToDomifiedAttrs refToOldStuff - domCreationF - topLevelNode - attrs - if touchDOM then (setAtts newNode newAttributes) else (pure ()) - newChildren <- mapM - (domify touchDOM refToOldStuff domCreationF newNode topLevelNode Nothing) - children - if touchDOM - then - (do - maybe - (liftIO $ _nodeAppendChild parentNode newNode) - (\x -> do - liftIO $ _nodeInsertBefore parentNode newNode x - liftIO $ _nodeRemoveChild parentNode x - ) - replacing - ) - else (pure ()) - liftIO $ return (DomifiedElement tag newAttributes newChildren newNode) -domify touchDOM _ _ parentNode topLevelNode replacing (HydratedTextNode text) = - do - _documentCreateElement <- asks documentCreateElement - _nodeAppendChild <- asks nodeAppendChild - _nodeInsertBefore <- asks nodeInsertBefore - _nodeRemoveChild <- asks nodeRemoveChild - _documentCreateTextNode <- asks documentCreateTextNode - newTextNode <- liftIO $ _documentCreateTextNode text - if touchDOM - then - (do - maybe - (liftIO $ _nodeAppendChild parentNode newTextNode) - (\x -> do - liftIO $ _nodeInsertBefore parentNode newTextNode x - liftIO $ _nodeRemoveChild parentNode x - ) - replacing - ) - else (pure ()) - liftIO $ return (DomifiedTextNode text newTextNode) - -getChildren :: DomifiedNode jsval -> [DomifiedNode jsval] -getChildren (DomifiedElement _ _ x _) = x -getChildren _ = [] - -setEventHandlers_ - :: jsval -> DomifiedNode jsval -> ReaderT (Browserful jsval) IO () -setEventHandlers_ v (DomifiedElement _ a _ _) = setEventHandlers v a -setEventHandlers_ _ _ = liftIO $ pure () - -transformFromCurrentDom - :: jsval - -> [DomifiedNode jsval] - -> ReaderT (Browserful jsval) IO [DomifiedNode jsval] -transformFromCurrentDom parentNode children = do - _nodeChildNodes <- asks nodeChildNodes - _kids <- liftIO $ _nodeChildNodes parentNode - let kids = maybe [] id _kids - newChildren <- sequence $ getZipList - ( transformFromCurrentDom - <$> (ZipList kids) - <*> (ZipList $ fmap getChildren children) - ) - sequence - $ getZipList (setEventHandlers_ <$> (ZipList kids) <*> (ZipList children)) - return $ getZipList - ( (\cur chldrn ptr -> cur { _dom_kids = chldrn, _dom_ptr = ptr }) - <$> (ZipList children) - <*> (ZipList newChildren) - <*> (ZipList kids) - ) - -addHandlers - :: jsval - -> DomifiedNode jsval - -> ReaderT (Browserful jsval) IO (DomifiedNode jsval) -addHandlers parentNode curDom = do - transformed <- transformFromCurrentDom parentNode [curDom] - return $ (transformed !! 0) - -__plzwrk - :: Bool - -> (state -> Node state jsval) - -> state - -> jsval - -> Browserful jsval - -> IO (Maybe (DomifiedNode jsval)) -__plzwrk cleanDOM domF state parentNode env = do - refToOldStuff <- newIORef (OldStuff state Nothing) - newDom <- runReaderT - (reconcile cleanDOM - refToOldStuff - domF - parentNode - parentNode - Nothing - (Just $ hydrate state domF) - ) - env - writeIORef refToOldStuff (OldStuff state newDom) - if (not cleanDOM) - then - (maybe - (pure Nothing) - (\y -> do - withHandlers <- runReaderT (addHandlers parentNode y) env - writeIORef refToOldStuff (OldStuff state (Just y)) - return $ Just withHandlers - ) - newDom - ) - else pure newDom - -_plzwrk - :: Bool - -> (state -> Node state jsval) - -> state - -> Browserful jsval - -> String - -> IO (Maybe (DomifiedNode jsval)) -_plzwrk cleanDOM domF state env nodeId = do - parentNode <- (documentGetElementById env) nodeId - maybe (error ("Node with id not in DOM: " <> show nodeId)) - (\x -> __plzwrk cleanDOM domF state x env) - parentNode - - --- |The main function that makes a web app. -plzwrk - :: (state -> Node state jsval) -- ^ A function that takes a state and produces a DOM - -> state -- ^ An initial state - -> Browserful jsval -- ^ A browser implementation, ie Asterius or the mock browser - -> String -- ^ The id of the element into which the DOM is inserted. Note that plzwrk manages all children under this element. Touching the managed elements can break plzwrk. - -> IO () -- ^ Returns nothing -plzwrk domF state env nodeId = void $ _plzwrk True domF state env nodeId - --- |A variant of plzwrk that acts on a node already rendered to the DOM, --- ie by server-side rendering. It assumes the node has been rendered --- with the same state-to-node function as well as the same state. -plzwrkSSR - :: (state -> Node state jsval) -- ^ A function that takes a state and produces a DOM - -> state -- ^ An initial state - -> Browserful jsval -- ^ A browser implementation, ie Asterius or the mock browser - -> String -- ^ The id of the element into which the DOM is inserted. Note that plzwrk manages all children under this element. Touching the managed elements can break plzwrk. - -> IO () -- ^ Returns nothing -plzwrkSSR domF state env nodeId = void $ _plzwrk False domF state env nodeId - -_plzwrk' - :: Bool - -> (state -> Node state jsval) - -> state - -> Browserful jsval - -> IO (Maybe (DomifiedNode jsval)) -_plzwrk' cleanDOM domF state env = do - parentNode <- (documentBody env) - __plzwrk cleanDOM domF state parentNode env - --- |A variation of plzwrk that inserts the node as a child of the document's body. -plzwrk' :: (state -> Node state jsval) -> state -> Browserful jsval -> IO () -plzwrk' domF state env = void $ _plzwrk' True domF state env - --- |A variation of plzwrk that inserts the node as a child of the document's body. -plzwrkSSR' :: (state -> Node state jsval) -> state -> Browserful jsval -> IO () -plzwrkSSR' domF state env = void $ _plzwrk' False domF state env - --- |A variation of plzwrk that takes no state. -plzwrk'_ :: (() -> Node () jsval) -> Browserful jsval -> IO () -plzwrk'_ domF env = plzwrk' domF () env - --- |A variation of plzwrkSSR that takes no state. -plzwrkSSR'_ :: (() -> Node () jsval) -> Browserful jsval -> IO () -plzwrkSSR'_ domF env = plzwrkSSR' domF () env +module Web.Framework.Plzwrk.Domify+ ( plzwrk+ , plzwrk'+ , plzwrk'_+ , plzwrkSSR+ , plzwrkSSR'+ , plzwrkSSR'_+ )+where++import Control.Applicative+import Data.List.Split+import Control.Monad+import Control.Monad.Reader+import Control.Monad.Trans+import Control.Monad.Trans.Maybe+import qualified Data.HashMap.Strict as HM+import Data.IORef+import Data.Maybe ( catMaybes )+import qualified Data.Set as S+import Web.Framework.Plzwrk.Base+import Web.Framework.Plzwrk.Browserful+import Web.Framework.Plzwrk.Util++data DomifiedAttribute jsval = DomifiedTextAttribute String | DomifiedFunctionAttribute jsval++data DomifiedPwNode jsval = DomifiedPwElement+ { _dom_tag :: String+ , _dom_attr :: [(String, DomifiedAttribute jsval)]+ , _dom_kids :: [DomifiedPwNode jsval]+ , _dom_ptr :: jsval+ }+ | DomifiedPwTextNode String jsval++data OldStuff state jsval = OldStuff {+ _oldState :: state,+ _oldDom :: Maybe (DomifiedPwNode jsval)+}++---------- reader functions+++freeAttrFunction :: DomifiedAttribute jsval -> ReaderT (Browserful jsval) IO ()+freeAttrFunction (DomifiedFunctionAttribute f) = do+ __freeCallback <- asks _freeCallback+ liftIO (void $ __freeCallback f)+freeAttrFunction _ = return ()++freeFunctions :: DomifiedPwNode jsval -> ReaderT (Browserful jsval) IO ()+freeFunctions (DomifiedPwElement _ b c _) = do+ mapM_ freeAttrFunction (fmap snd b)+ mapM_ freeFunctions c+freeFunctions _ = pure ()++data AttributeHack = MkAttributeHack+ { _hackishStyle :: HM.HashMap String String+ , _hackishClass :: S.Set String+ , _hackishSimple :: HM.HashMap String String+ } deriving (Eq)++getStyleFrom :: [(String, String)] -> HM.HashMap String String+getStyleFrom l = HM.unions+ (fmap stylishAttributes $ filter (\(x, _) -> x == "style") l) where+ stylishAttributes :: (String, String) -> HM.HashMap String String+ stylishAttributes (_, y) = HM.fromList $ fmap+ (\s -> let ss = splitOn ":" s in (ss !! 0, ss !! 1))+ (filter (\x -> elem ':' x) (splitOn ";" y))++getClassFrom :: [(String, String)] -> S.Set String+getClassFrom l = S.unions+ (fmap classyAttributes $ filter (\(x, _) -> x == "class") l) where+ classyAttributes :: (String, String) -> S.Set String+ classyAttributes (_, y) = S.fromList (words y)++getSimpleFrom :: [(String, String)] -> HM.HashMap String String+getSimpleFrom l = HM.unions (fmap simplyAttributes l) where+ simplyAttributes :: (String, String) -> HM.HashMap String String+ simplyAttributes (x, y) =+ if (x /= "class" && x /= "style") then HM.singleton x y else HM.empty++attributeListToSplitAttrs :: [(String, String)] -> AttributeHack+attributeListToSplitAttrs fl =+ MkAttributeHack (getStyleFrom fl) (getClassFrom fl) (getSimpleFrom fl)++isDText :: (String, DomifiedAttribute jsval) -> Maybe (String, String)+isDText (k, DomifiedTextAttribute v) = Just (k, v)+isDText _ = Nothing++isPwText :: (String, PwAttribute s jsval) -> Maybe (String, String)+isPwText (k, PwTextAttribute v) = Just (k, v)+isPwText _ = Nothing+++daToF :: [(String, DomifiedAttribute jsval)] -> [(String, String)]+daToF l = catMaybes $ fmap isDText l++paToF :: [(String, PwAttribute s jsval)] -> [(String, String)]+paToF l = catMaybes $ fmap isPwText l++nodesEq+ :: String+ -> String+ -> [(String, DomifiedAttribute jsval)]+ -> [(String, PwAttribute s jsval)]+ -> Bool+nodesEq t0 t1 a0 a1 =+ (t0 == t1)+ && ( attributeListToSplitAttrs (daToF a0)+ == attributeListToSplitAttrs (paToF a1)+ )++padr :: Int -> a -> [a] -> [a]+padr i v l = if (length l >= i) then l else padr i v (l ++ [v])++reconcile+ :: Bool+ -> IORef (OldStuff state jsval)+ -> (state -> PwNode state jsval)+ -> jsval+ -> jsval+ -> Maybe (DomifiedPwNode jsval)+ -> Maybe (HydratedPwNode state jsval)+ -> ReaderT+ (Browserful jsval)+ IO+ (Maybe (DomifiedPwNode jsval))+reconcile touchDOM refToOldStuff domCreationF parentNode topLevelNode (Just (DomifiedPwElement currentTag currentAttributes currentChildren currentNode)) (Just maybeNewNode@(HydratedPwElement maybeNewTag maybeNewAttributes maybeNewChildren))+ = if (nodesEq currentTag maybeNewTag currentAttributes maybeNewAttributes)+ then+ (do+ let maxlen = max (length maybeNewChildren) (length currentChildren)+ newChildren <- sequence $ getZipList+ ( (reconcile touchDOM+ refToOldStuff+ domCreationF+ currentNode+ topLevelNode+ )+ <$> (ZipList (padr maxlen Nothing (fmap Just currentChildren)))+ <*> (ZipList (padr maxlen Nothing (fmap Just maybeNewChildren)))+ )+ currentAttributes <- mapM+ (hydratedAttrToDomifiedAttr refToOldStuff domCreationF parentNode)+ maybeNewAttributes+ if touchDOM+ then+ (do+ mapM_ (removeEventHandler currentNode) currentAttributes+ mapM_ (setEventHandler currentNode) currentAttributes+ )+ else (pure ())+ return $ Just+ (DomifiedPwElement currentTag+ currentAttributes+ (catMaybes newChildren)+ currentNode+ )+ )+ else+ (do+ res <- domify touchDOM+ refToOldStuff+ domCreationF+ parentNode+ topLevelNode+ (Just currentNode)+ maybeNewNode+ return $ Just res+ )+reconcile touchDOM refToOldStuff domCreationF parentNode topLevelNode (Just currentDomifiedString@(DomifiedPwTextNode currentString currentNode)) (Just maybeNewNode@(HydratedPwTextNode maybeNewString))+ = if (currentString == maybeNewString)+ then pure (Just currentDomifiedString)+ else+ (do+ res <- domify touchDOM+ refToOldStuff+ domCreationF+ parentNode+ topLevelNode+ (Just currentNode)+ maybeNewNode+ return $ Just res+ )+reconcile touchDOM refToOldStuff domCreationF parentNode topLevelNode (Just (DomifiedPwElement _ _ _ currentNode)) (Just maybeNewNode@(HydratedPwTextNode _))+ = do+ res <- domify touchDOM+ refToOldStuff+ domCreationF+ parentNode+ topLevelNode+ (Just currentNode)+ maybeNewNode+ return $ Just res+reconcile touchDOM refToOldStuff domCreationF parentNode topLevelNode (Just (DomifiedPwTextNode _ currentNode)) (Just maybeNewNode@(HydratedPwElement _ _ _))+ = do+ res <- domify touchDOM+ refToOldStuff+ domCreationF+ parentNode+ topLevelNode+ (Just currentNode)+ maybeNewNode+ return $ Just res+reconcile touchDOM refToOldStuff domCreationF parentNode topLevelNode Nothing (Just maybeNewNode)+ = do+ res <- domify touchDOM+ refToOldStuff+ domCreationF+ parentNode+ topLevelNode+ Nothing+ maybeNewNode+ return $ Just res+reconcile touchDOM refToOldStuff domCreationF parentNode _ (Just (DomifiedPwElement _ _ _ currentNode)) Nothing+ = if (touchDOM)+ then+ (do+ _nodeRemoveChild <- asks nodeRemoveChild+ liftIO $ _nodeRemoveChild parentNode currentNode+ return Nothing+ )+ else (pure Nothing)+reconcile touchDOM refToOldStuff domCreationF parentNode _ (Just (DomifiedPwTextNode _ currentNode)) Nothing+ = if (touchDOM)+ then+ (do+ _nodeRemoveChild <- asks nodeRemoveChild+ liftIO $ _nodeRemoveChild parentNode currentNode+ return Nothing+ )+ else (pure Nothing)+reconcile _ _ _ _ _ _ _ = error "Inconsistent state"++reconcileAndAdd = reconcile True++cbMaker+ :: IORef (OldStuff state jsval)+ -> (state -> PwNode state jsval)+ -> jsval+ -> (jsval -> state -> IO state)+ -> Browserful jsval+ -> jsval+ -> IO ()+cbMaker refToOldStuff domCreationF topLevelNode eventToState env event = do+ oldStuff <- readIORef refToOldStuff+ let oldDom = _oldDom oldStuff+ let oldState = _oldState oldStuff+ newState <- eventToState event oldState+ let newHydratedDom = hydrate newState domCreationF+ newDom <- runReaderT+ (reconcileAndAdd refToOldStuff+ domCreationF+ topLevelNode+ topLevelNode+ oldDom+ (Just newHydratedDom)+ )+ env+ maybe (pure ()) (\x -> runReaderT (freeFunctions x) env) oldDom+ writeIORef refToOldStuff (OldStuff newState newDom)++eventable+ :: IORef (OldStuff state jsval)+ -> (state -> PwNode state jsval)+ -> jsval+ -> (jsval -> state -> IO state)+ -> ReaderT (Browserful jsval) IO jsval+eventable refToOldStuff domCreationF topLevelNode eventToState = do+ __makeHaskellCallback <- asks _makeHaskellCallback+ env <- ask+ liftIO $ __makeHaskellCallback+ (cbMaker refToOldStuff domCreationF topLevelNode eventToState env)++hydratedAttrToDomifiedAttr+ :: IORef (OldStuff state jsval)+ -> (state -> PwNode state jsval)+ -> jsval+ -> (String, PwAttribute state jsval)+ -> ReaderT (Browserful jsval) IO (String, DomifiedAttribute jsval)+hydratedAttrToDomifiedAttr refToOldStuff domCreationF topLevelNode (k, PwTextAttribute t)+ = return $ (k, DomifiedTextAttribute t)+hydratedAttrToDomifiedAttr refToOldStuff domCreationF topLevelNode (k, PwFunctionAttribute f)+ = do+ func <- eventable refToOldStuff domCreationF topLevelNode f+ return $ (k, DomifiedFunctionAttribute func)++setAtt+ :: jsval+ -> (String, DomifiedAttribute jsval)+ -> ReaderT (Browserful jsval) IO ()+setAtt currentNode (k, DomifiedTextAttribute v) = do+ _elementSetAttribute <- asks elementSetAttribute+ liftIO $ _elementSetAttribute currentNode k v+setAtt currentNode kv = setEventHandler currentNode kv++handleOnlyEventListener+ :: (jsval -> String -> jsval -> IO ())+ -> jsval+ -> (String, DomifiedAttribute jsval)+ -> IO ()+handleOnlyEventListener eventListenerHandlerF currentNode (k, DomifiedFunctionAttribute v)+ = eventListenerHandlerF currentNode k v+handleOnlyEventListener _ _ _ = pure ()++setEventHandler+ :: jsval+ -> (String, DomifiedAttribute jsval)+ -> ReaderT (Browserful jsval) IO ()+setEventHandler currentNode domifiedAttribute = do+ _eventTargetAddEventListener <- asks eventTargetAddEventListener+ liftIO $ handleOnlyEventListener _eventTargetAddEventListener+ currentNode+ domifiedAttribute++removeEventHandler+ :: jsval+ -> (String, DomifiedAttribute jsval)+ -> ReaderT (Browserful jsval) IO ()+removeEventHandler currentNode domifiedAttribute = do+ _eventTargetRemoveEventListener <- asks eventTargetRemoveEventListener+ liftIO $ handleOnlyEventListener _eventTargetRemoveEventListener+ currentNode+ domifiedAttribute++domify+ :: Bool+ -> IORef (OldStuff state jsval)+ -> (state -> PwNode state jsval)+ -> jsval+ -> jsval+ -> Maybe jsval+ -> HydratedPwNode state jsval+ -> ReaderT (Browserful jsval) IO (DomifiedPwNode jsval)+domify touchDOM refToOldStuff domCreationF parentNode topLevelNode replacing (HydratedPwElement tag attrs children)+ = do+ _documentCreateElement <- asks documentCreateElement+ _nodeAppendChild <- asks nodeAppendChild+ _nodeInsertBefore <- asks nodeInsertBefore+ _nodeRemoveChild <- asks nodeRemoveChild+ newNode <- liftIO $ _documentCreateElement tag+ newAttributes <- mapM+ (hydratedAttrToDomifiedAttr refToOldStuff domCreationF topLevelNode)+ attrs+ if touchDOM then (mapM_ (setAtt newNode) newAttributes) else (pure ())+ newChildren <- mapM+ (domify touchDOM refToOldStuff domCreationF newNode topLevelNode Nothing)+ children+ if touchDOM+ then+ (do+ maybe+ (liftIO $ _nodeAppendChild parentNode newNode)+ (\x -> do+ liftIO $ _nodeInsertBefore parentNode newNode x+ liftIO $ _nodeRemoveChild parentNode x+ )+ replacing+ )+ else (pure ())+ liftIO $ return (DomifiedPwElement tag newAttributes newChildren newNode)+domify touchDOM _ _ parentNode topLevelNode replacing (HydratedPwTextNode text)+ = do+ _documentCreateElement <- asks documentCreateElement+ _nodeAppendChild <- asks nodeAppendChild+ _nodeInsertBefore <- asks nodeInsertBefore+ _nodeRemoveChild <- asks nodeRemoveChild+ _documentCreateTextNode <- asks documentCreateTextNode+ newTextNode <- liftIO $ _documentCreateTextNode text+ if touchDOM+ then+ (do+ maybe+ (liftIO $ _nodeAppendChild parentNode newTextNode)+ (\x -> do+ liftIO $ _nodeInsertBefore parentNode newTextNode x+ liftIO $ _nodeRemoveChild parentNode x+ )+ replacing+ )+ else (pure ())+ liftIO $ return (DomifiedPwTextNode text newTextNode)++getChildren :: DomifiedPwNode jsval -> [DomifiedPwNode jsval]+getChildren (DomifiedPwElement _ _ x _) = x+getChildren _ = []++setEventHandlers_+ :: jsval -> DomifiedPwNode jsval -> ReaderT (Browserful jsval) IO ()+setEventHandlers_ v (DomifiedPwElement _ a _ _) = mapM_ (setEventHandler v) a+setEventHandlers_ _ _ = liftIO $ pure ()++transformFromCurrentDom+ :: jsval+ -> [DomifiedPwNode jsval]+ -> ReaderT (Browserful jsval) IO [DomifiedPwNode jsval]+transformFromCurrentDom parentNode children = do+ _nodeChildNodes <- asks nodeChildNodes+ _kids <- liftIO $ _nodeChildNodes parentNode+ let kids = maybe [] id _kids+ newChildren <- sequence $ getZipList+ ( transformFromCurrentDom+ <$> (ZipList kids)+ <*> (ZipList $ fmap getChildren children)+ )+ sequence+ $ getZipList (setEventHandlers_ <$> (ZipList kids) <*> (ZipList children))+ return $ getZipList+ ( (\cur chldrn ptr -> cur { _dom_kids = chldrn, _dom_ptr = ptr })+ <$> (ZipList children)+ <*> (ZipList newChildren)+ <*> (ZipList kids)+ )++addHandlers+ :: jsval+ -> DomifiedPwNode jsval+ -> ReaderT (Browserful jsval) IO (DomifiedPwNode jsval)+addHandlers parentNode curDom = do+ transformed <- transformFromCurrentDom parentNode [curDom]+ return $ (transformed !! 0)++__plzwrk+ :: Bool+ -> (state -> PwNode state jsval)+ -> state+ -> jsval+ -> Browserful jsval+ -> IO (Maybe (DomifiedPwNode jsval))+__plzwrk cleanDOM domF state parentNode env = do+ refToOldStuff <- newIORef (OldStuff state Nothing)+ newDom <- runReaderT+ (reconcile cleanDOM+ refToOldStuff+ domF+ parentNode+ parentNode+ Nothing+ (Just $ hydrate state domF)+ )+ env+ writeIORef refToOldStuff (OldStuff state newDom)+ if (not cleanDOM)+ then+ (maybe+ (pure Nothing)+ (\y -> do+ withHandlers <- runReaderT (addHandlers parentNode y) env+ writeIORef refToOldStuff (OldStuff state (Just y))+ return $ Just withHandlers+ )+ newDom+ )+ else pure newDom++_plzwrk+ :: Bool+ -> (state -> PwNode state jsval)+ -> state+ -> Browserful jsval+ -> String+ -> IO (Maybe (DomifiedPwNode jsval))+_plzwrk cleanDOM domF state env nodeId = do+ parentNode <- (documentGetElementById env) nodeId+ maybe (error ("Node with id not in DOM: " <> show nodeId))+ (\x -> __plzwrk cleanDOM domF state x env)+ parentNode+++-- |The main function that makes a web app.++plzwrk+ :: (state -> PwNode state jsval) -- ^ A function that takes a state and produces a DOM+ -> state -- ^ An initial state+ -> Browserful jsval -- ^ A browser implementation, ie Asterius or the mock browser+ -> String -- ^ The id of the element into which the DOM is inserted. Note that plzwrk manages all children under this element. Touching the managed elements can break plzwrk.+ -> IO () -- ^ Returns nothing++plzwrk domF state env nodeId = void $ _plzwrk True domF state env nodeId++-- |A variant of plzwrk that acts on a node already rendered to the DOM,++-- ie by server-side rendering. It assumes the node has been rendered++-- with the same state-to-node function as well as the same state.++plzwrkSSR+ :: (state -> PwNode state jsval) -- ^ A function that takes a state and produces a DOM+ -> state -- ^ An initial state+ -> Browserful jsval -- ^ A browser implementation, ie Asterius or the mock browser+ -> String -- ^ The id of the element into which the DOM is inserted. Note that plzwrk manages all children under this element. Touching the managed elements can break plzwrk.+ -> IO () -- ^ Returns nothing++plzwrkSSR domF state env nodeId = void $ _plzwrk False domF state env nodeId++_plzwrk'+ :: Bool+ -> (state -> PwNode state jsval)+ -> state+ -> Browserful jsval+ -> IO (Maybe (DomifiedPwNode jsval))+_plzwrk' cleanDOM domF state env = do+ parentNode <- (documentBody env)+ __plzwrk cleanDOM domF state parentNode env++-- |A variation of plzwrk that inserts the node as a child of the document's body.++plzwrk' :: (state -> PwNode state jsval) -> state -> Browserful jsval -> IO ()+plzwrk' domF state env = void $ _plzwrk' True domF state env++-- |A variation of plzwrk that inserts the node as a child of the document's body.++plzwrkSSR'+ :: (state -> PwNode state jsval) -> state -> Browserful jsval -> IO ()+plzwrkSSR' domF state env = void $ _plzwrk' False domF state env++-- |A variation of plzwrk that takes no state.++plzwrk'_ :: (() -> PwNode () jsval) -> Browserful jsval -> IO ()+plzwrk'_ domF env = plzwrk' domF () env++-- |A variation of plzwrkSSR that takes no state.++plzwrkSSR'_ :: (() -> PwNode () jsval) -> Browserful jsval -> IO ()+plzwrkSSR'_ domF env = plzwrkSSR' domF () env
+ src/Web/Framework/Plzwrk/TH/HSX.hs view
@@ -0,0 +1,120 @@+module Web.Framework.Plzwrk.TH.HSX+ ( HSXAttribute(..)+ , HSX(..)+ , parseHSX+ )+where++import Control.Applicative ( (<*)+ , (*>)+ , (<$>)+ , (<$)+ )+import Control.Monad ( void )+import Data.Char+import Data.List ( foldl' )+import Text.Parsec+import Text.Parsec.String++data HSXAttribute = HSXStringAttribute String+ | HSXHaskellCodeAttribute String+ | HSXHaskellTxtAttribute String deriving (Show, Eq)++data HSX = HSXElement String [(String, HSXAttribute)] [HSX]+ | HSXSelfClosingTag String [(String, HSXAttribute)]+ | HSXHaskellCode String+ | HSXHaskellText String+ | HSXBody String+ deriving (Show, Eq)++hsx :: Parser HSX+hsx = tag++tag = do+ char '<'+ ws+ name <- many (letter <|> digit)+ ws+ attr <- many attribute+ ws+ close <- try (string "/>" <|> string ">")+ if (length close) == 2+ then return (HSXSelfClosingTag name attr)+ else do+ elementHSXBody <- manyTill elementHSXBody (endTag name)+ ws+ return (HSXElement name attr elementHSXBody)++elementHSXBody = ws *> (try tag <|> try haskellCodeNode <|> try haskellTxtNode <|> text)++endTag :: String -> Parser String+endTag str = string "</" *> string str <* char '>'++text = HSXBody <$> many1 (noneOf "><")++stringAttribute = do+ char '"'+ value <- many (noneOf ['"'])+ char '"'+ return $ HSXStringAttribute value++haskellTxtAttr = do+ string "#t{"+ value <- manyTill anyChar (string "}#")+ ws+ return $ HSXHaskellTxtAttribute value+++haskellCodeAttr = do+ string "#c{"+ value <- manyTill anyChar (string "}#")+ ws+ return $ HSXHaskellCodeAttribute value++haskellCodeNode :: Parser HSX+haskellCodeNode = do+ string "#e{"+ value <- manyTill anyChar (string "}#")+ ws+ return $ HSXHaskellCode value++haskellTxtNode :: Parser HSX+haskellTxtNode = do+ string "#t{"+ value <- manyTill anyChar (string "}#")+ ws+ return $ HSXHaskellText value+++attribute = do+ name <- many (noneOf "= />") + ws+ char '='+ ws+ value <- stringAttribute <|> (try haskellCodeAttr) <|> haskellTxtAttr+ ws+ return (name, value)++ws :: Parser ()+ws = void $ many $ oneOf " \t\r\n"++parseHSX :: MonadFail m => (String, Int, Int) -> String -> m HSX+parseHSX (file, line, col) s =+ case runParser p () "" s of+ Left err -> fail $ show err+ Right e -> return e+ where+ p = do updatePosition file line col+ ws+ e <- hsx+ ws+ eof+ return e++updatePosition file line col = do+ pos <- getPosition+ setPosition $+ (flip setSourceName) file $+ (flip setSourceLine) line $+ (flip setSourceColumn) col $+ pos
+ src/Web/Framework/Plzwrk/TH/QuoteHSX.hs view
@@ -0,0 +1,95 @@+module Web.Framework.Plzwrk.TH.QuoteHSX+ ( hsx+ , hsx'+ , hmFromList+ )+where++import Data.List.Split+import qualified Data.Hashable as H+import qualified Language.Haskell.TH as TH+import Language.Haskell.Meta.Parse ( parseExp )+import Language.Haskell.TH.Quote+import Language.Haskell.TH.Syntax+import Web.Framework.Plzwrk.TH.HSX+import Web.Framework.Plzwrk.Base+import qualified Data.HashMap.Strict as HM+import qualified Data.Set as S+++hsx :: QuasiQuoter+hsx = QuasiQuoter { quoteExp = quoteExprExp True+ , quotePat = undefined+ , quoteDec = undefined+ , quoteType = undefined+ }++hsx' :: QuasiQuoter+hsx' = QuasiQuoter { quoteExp = quoteExprExp False+ , quotePat = undefined+ , quoteDec = undefined+ , quoteType = undefined+ }++haskize y = either+ (\s -> TH.appE+ (TH.varE (TH.mkName "error"))+ (TH.litE (TH.StringL $ "Could not parse: " <> y <> " due to error " <> s))+ )+ returnQ+ (parseExp y)++hmFromList :: (Eq k, H.Hashable k) => [(k, v)] -> HM.HashMap k v+hmFromList = HM.fromList++hsxAttributeToExpQ :: (String, HSXAttribute) -> TH.Q TH.Exp+hsxAttributeToExpQ (k, HSXStringAttribute v) = TH.tupE+ [ TH.litE (TH.StringL k)+ , TH.lamE+ [TH.varP (TH.mkName "_")]+ (TH.appE (TH.conE (TH.mkName "PwTextAttribute")) (TH.litE (TH.StringL v)))+ ]+hsxAttributeToExpQ (k, HSXHaskellCodeAttribute v) = TH.tupE+ [ TH.litE (TH.StringL k)+ , TH.lamE [TH.varP (TH.mkName "_")]+ (TH.appE (TH.conE (TH.mkName "PwFunctionAttribute")) (haskize v))+ ]+hsxAttributeToExpQ (k, HSXHaskellTxtAttribute v) = TH.tupE+ [ TH.litE (TH.StringL k)+ , TH.lamE [TH.varP (TH.mkName "_")]+ (TH.appE (TH.conE (TH.mkName "PwTextAttribute")) (haskize v))+ ]+++wrapInLambda :: Bool -> TH.Q TH.Exp -> TH.Q TH.Exp+wrapInLambda True e = TH.lamE [TH.varP (TH.mkName "_")] e+wrapInLambda False e = e++hsxToExpQ :: Bool -> HSX -> TH.Q TH.Exp+hsxToExpQ lam (HSXHaskellCode y ) = haskize y+hsxToExpQ lam (HSXHaskellText y ) = wrapInLambda True $ TH.appE (TH.conE (TH.mkName "PwTextNode")) (haskize y)+hsxToExpQ lam (HSXElement tag attrs elts) = wrapInLambda lam $ foldl+ TH.appE+ (TH.conE (TH.mkName "PwElement"))+ [ TH.litE (TH.StringL tag)+ , TH.listE (fmap hsxAttributeToExpQ attrs)+ , TH.listE (fmap (\x -> hsxToExpQ True x) elts)+ ]+hsxToExpQ lam (HSXSelfClosingTag tag attrs) = wrapInLambda lam $ foldl+ TH.appE+ (TH.conE (TH.mkName "PwElement"))+ [ (TH.litE (TH.StringL tag))+ , TH.listE (fmap hsxAttributeToExpQ attrs)+ , (TH.conE (TH.mkName "[]"))+ ]+hsxToExpQ lam (HSXBody b) = wrapInLambda lam+ $ TH.appE (TH.conE (TH.mkName "PwTextNode")) (TH.litE (TH.StringL b))++quoteExprExp b s = do+ pos <- getPosition+ result <- parseHSX pos s+ hsxToExpQ b result++getPosition = fmap transPos TH.location where+ transPos loc =+ (TH.loc_filename loc, fst (TH.loc_start loc), snd (TH.loc_start loc))
src/Web/Framework/Plzwrk/Tag.hs view
@@ -772,2280 +772,2280 @@ import Web.Framework.Plzwrk.Base type AFSig s opq - = (s -> Attributes s opq) -> [s -> Node s opq] -> (s -> Node s opq) -type Sig s opq = (s -> Attributes s opq) -> [s -> Node s opq] -> Node s opq - -type AFSig_ s opq = [s -> Node s opq] -> (s -> Node s opq) -type Sig_ s opq = [s -> Node s opq] -> Node s opq - -type AFSig__ s opq = String -> (s -> Node s opq) -type Sig__ s opq = String -> Node s opq - - -a :: AFSig s opq -a x y = (\_ -> Element "a" x y) - -a' :: Sig s opq -a' = Element "a" - -a_ :: AFSig_ s opq -a_ x = (\_ -> Element "a" dats x) - -a'_ :: Sig_ s opq -a'_ x = Element "a" dats x - -a__ :: AFSig__ s opq -a__ x = (\_ -> Element "a" dats [txt x]) - -a'__ :: Sig__ s opq -a'__ x = Element "a" dats [txt x] - - -abbr :: AFSig s opq -abbr x y = (\_ -> Element "abbr" x y) - -abbr' :: Sig s opq -abbr' = Element "abbr" - -abbr_ :: AFSig_ s opq -abbr_ x = (\_ -> Element "abbr" dats x) - -abbr'_ :: Sig_ s opq -abbr'_ x = Element "abbr" dats x - -abbr__ :: AFSig__ s opq -abbr__ x = (\_ -> Element "abbr" dats [txt x]) - -abbr'__ :: Sig__ s opq -abbr'__ x = Element "abbr" dats [txt x] - - -acronym :: AFSig s opq -acronym x y = (\_ -> Element "acronym" x y) - -acronym' :: Sig s opq -acronym' = Element "acronym" - -acronym_ :: AFSig_ s opq -acronym_ x = (\_ -> Element "acronym" dats x) - -acronym'_ :: Sig_ s opq -acronym'_ x = Element "acronym" dats x - -acronym__ :: AFSig__ s opq -acronym__ x = (\_ -> Element "acronym" dats [txt x]) - -acronym'__ :: Sig__ s opq -acronym'__ x = Element "acronym" dats [txt x] - - -address :: AFSig s opq -address x y = (\_ -> Element "address" x y) - -address' :: Sig s opq -address' = Element "address" - -address_ :: AFSig_ s opq -address_ x = (\_ -> Element "address" dats x) - -address'_ :: Sig_ s opq -address'_ x = Element "address" dats x - -address__ :: AFSig__ s opq -address__ x = (\_ -> Element "address" dats [txt x]) - -address'__ :: Sig__ s opq -address'__ x = Element "address" dats [txt x] - - -applet :: AFSig s opq -applet x y = (\_ -> Element "applet" x y) - -applet' :: Sig s opq -applet' = Element "applet" - -applet_ :: AFSig_ s opq -applet_ x = (\_ -> Element "applet" dats x) - -applet'_ :: Sig_ s opq -applet'_ x = Element "applet" dats x - -applet__ :: AFSig__ s opq -applet__ x = (\_ -> Element "applet" dats [txt x]) - -applet'__ :: Sig__ s opq -applet'__ x = Element "applet" dats [txt x] - - -area :: AFSig s opq -area x y = (\_ -> Element "area" x y) - -area' :: Sig s opq -area' = Element "area" - -area_ :: AFSig_ s opq -area_ x = (\_ -> Element "area" dats x) - -area'_ :: Sig_ s opq -area'_ x = Element "area" dats x - -area__ :: AFSig__ s opq -area__ x = (\_ -> Element "area" dats [txt x]) - -area'__ :: Sig__ s opq -area'__ x = Element "area" dats [txt x] - - -article :: AFSig s opq -article x y = (\_ -> Element "article" x y) - -article' :: Sig s opq -article' = Element "article" - -article_ :: AFSig_ s opq -article_ x = (\_ -> Element "article" dats x) - -article'_ :: Sig_ s opq -article'_ x = Element "article" dats x - -article__ :: AFSig__ s opq -article__ x = (\_ -> Element "article" dats [txt x]) - -article'__ :: Sig__ s opq -article'__ x = Element "article" dats [txt x] - - -aside :: AFSig s opq -aside x y = (\_ -> Element "aside" x y) - -aside' :: Sig s opq -aside' = Element "aside" - -aside_ :: AFSig_ s opq -aside_ x = (\_ -> Element "aside" dats x) - -aside'_ :: Sig_ s opq -aside'_ x = Element "aside" dats x - -aside__ :: AFSig__ s opq -aside__ x = (\_ -> Element "aside" dats [txt x]) - -aside'__ :: Sig__ s opq -aside'__ x = Element "aside" dats [txt x] - - -audio :: AFSig s opq -audio x y = (\_ -> Element "audio" x y) - -audio' :: Sig s opq -audio' = Element "audio" - -audio_ :: AFSig_ s opq -audio_ x = (\_ -> Element "audio" dats x) - -audio'_ :: Sig_ s opq -audio'_ x = Element "audio" dats x - -audio__ :: AFSig__ s opq -audio__ x = (\_ -> Element "audio" dats [txt x]) - -audio'__ :: Sig__ s opq -audio'__ x = Element "audio" dats [txt x] - - -b :: AFSig s opq -b x y = (\_ -> Element "b" x y) - -b' :: Sig s opq -b' = Element "b" - -b_ :: AFSig_ s opq -b_ x = (\_ -> Element "b" dats x) - -b'_ :: Sig_ s opq -b'_ x = Element "b" dats x - -b__ :: AFSig__ s opq -b__ x = (\_ -> Element "b" dats [txt x]) - -b'__ :: Sig__ s opq -b'__ x = Element "b" dats [txt x] - - -base :: AFSig s opq -base x y = (\_ -> Element "base" x y) - -base' :: Sig s opq -base' = Element "base" - -base_ :: AFSig_ s opq -base_ x = (\_ -> Element "base" dats x) - -base'_ :: Sig_ s opq -base'_ x = Element "base" dats x - -base__ :: AFSig__ s opq -base__ x = (\_ -> Element "base" dats [txt x]) - -base'__ :: Sig__ s opq -base'__ x = Element "base" dats [txt x] - - -basefont :: AFSig s opq -basefont x y = (\_ -> Element "basefont" x y) - -basefont' :: Sig s opq -basefont' = Element "basefont" - -basefont_ :: AFSig_ s opq -basefont_ x = (\_ -> Element "basefont" dats x) - -basefont'_ :: Sig_ s opq -basefont'_ x = Element "basefont" dats x - -basefont__ :: AFSig__ s opq -basefont__ x = (\_ -> Element "basefont" dats [txt x]) - -basefont'__ :: Sig__ s opq -basefont'__ x = Element "basefont" dats [txt x] - - -bdi :: AFSig s opq -bdi x y = (\_ -> Element "bdi" x y) - -bdi' :: Sig s opq -bdi' = Element "bdi" - -bdi_ :: AFSig_ s opq -bdi_ x = (\_ -> Element "bdi" dats x) - -bdi'_ :: Sig_ s opq -bdi'_ x = Element "bdi" dats x - -bdi__ :: AFSig__ s opq -bdi__ x = (\_ -> Element "bdi" dats [txt x]) - -bdi'__ :: Sig__ s opq -bdi'__ x = Element "bdi" dats [txt x] - - -bdo :: AFSig s opq -bdo x y = (\_ -> Element "bdo" x y) - -bdo' :: Sig s opq -bdo' = Element "bdo" - -bdo_ :: AFSig_ s opq -bdo_ x = (\_ -> Element "bdo" dats x) - -bdo'_ :: Sig_ s opq -bdo'_ x = Element "bdo" dats x - -bdo__ :: AFSig__ s opq -bdo__ x = (\_ -> Element "bdo" dats [txt x]) - -bdo'__ :: Sig__ s opq -bdo'__ x = Element "bdo" dats [txt x] - - -big :: AFSig s opq -big x y = (\_ -> Element "big" x y) - -big' :: Sig s opq -big' = Element "big" - -big_ :: AFSig_ s opq -big_ x = (\_ -> Element "big" dats x) - -big'_ :: Sig_ s opq -big'_ x = Element "big" dats x - -big__ :: AFSig__ s opq -big__ x = (\_ -> Element "big" dats [txt x]) - -big'__ :: Sig__ s opq -big'__ x = Element "big" dats [txt x] - - -blockquote :: AFSig s opq -blockquote x y = (\_ -> Element "blockquote" x y) - -blockquote' :: Sig s opq -blockquote' = Element "blockquote" - -blockquote_ :: AFSig_ s opq -blockquote_ x = (\_ -> Element "blockquote" dats x) - -blockquote'_ :: Sig_ s opq -blockquote'_ x = Element "blockquote" dats x - -blockquote__ :: AFSig__ s opq -blockquote__ x = (\_ -> Element "blockquote" dats [txt x]) - -blockquote'__ :: Sig__ s opq -blockquote'__ x = Element "blockquote" dats [txt x] - - -body :: AFSig s opq -body x y = (\_ -> Element "body" x y) - -body' :: Sig s opq -body' = Element "body" - -body_ :: AFSig_ s opq -body_ x = (\_ -> Element "body" dats x) - -body'_ :: Sig_ s opq -body'_ x = Element "body" dats x - -body__ :: AFSig__ s opq -body__ x = (\_ -> Element "body" dats [txt x]) - -body'__ :: Sig__ s opq -body'__ x = Element "body" dats [txt x] - - -br :: (s -> Node s opq) -br = (\_ -> Element "br" dats []) - -button :: AFSig s opq -button x y = (\_ -> Element "button" x y) - -button' :: Sig s opq -button' = Element "button" - -button_ :: AFSig_ s opq -button_ x = (\_ -> Element "button" dats x) - -button'_ :: Sig_ s opq -button'_ x = Element "button" dats x - -button__ :: AFSig__ s opq -button__ x = (\_ -> Element "button" dats [txt x]) - -button'__ :: Sig__ s opq -button'__ x = Element "button" dats [txt x] - - -canvas :: AFSig s opq -canvas x y = (\_ -> Element "canvas" x y) - -canvas' :: Sig s opq -canvas' = Element "canvas" - -canvas_ :: AFSig_ s opq -canvas_ x = (\_ -> Element "canvas" dats x) - -canvas'_ :: Sig_ s opq -canvas'_ x = Element "canvas" dats x - -canvas__ :: AFSig__ s opq -canvas__ x = (\_ -> Element "canvas" dats [txt x]) - -canvas'__ :: Sig__ s opq -canvas'__ x = Element "canvas" dats [txt x] - - -caption :: AFSig s opq -caption x y = (\_ -> Element "caption" x y) - -caption' :: Sig s opq -caption' = Element "caption" - -caption_ :: AFSig_ s opq -caption_ x = (\_ -> Element "caption" dats x) - -caption'_ :: Sig_ s opq -caption'_ x = Element "caption" dats x - -caption__ :: AFSig__ s opq -caption__ x = (\_ -> Element "caption" dats [txt x]) - -caption'__ :: Sig__ s opq -caption'__ x = Element "caption" dats [txt x] - - -center :: AFSig s opq -center x y = (\_ -> Element "center" x y) - -center' :: Sig s opq -center' = Element "center" - -center_ :: AFSig_ s opq -center_ x = (\_ -> Element "center" dats x) - -center'_ :: Sig_ s opq -center'_ x = Element "center" dats x - -center__ :: AFSig__ s opq -center__ x = (\_ -> Element "center" dats [txt x]) - -center'__ :: Sig__ s opq -center'__ x = Element "center" dats [txt x] - - -cite :: AFSig s opq -cite x y = (\_ -> Element "cite" x y) - -cite' :: Sig s opq -cite' = Element "cite" - -cite_ :: AFSig_ s opq -cite_ x = (\_ -> Element "cite" dats x) - -cite'_ :: Sig_ s opq -cite'_ x = Element "cite" dats x - -cite__ :: AFSig__ s opq -cite__ x = (\_ -> Element "cite" dats [txt x]) - -cite'__ :: Sig__ s opq -cite'__ x = Element "cite" dats [txt x] - - -code :: AFSig s opq -code x y = (\_ -> Element "code" x y) - -code' :: Sig s opq -code' = Element "code" - -code_ :: AFSig_ s opq -code_ x = (\_ -> Element "code" dats x) - -code'_ :: Sig_ s opq -code'_ x = Element "code" dats x - -code__ :: AFSig__ s opq -code__ x = (\_ -> Element "code" dats [txt x]) - -code'__ :: Sig__ s opq -code'__ x = Element "code" dats [txt x] - - -col :: AFSig s opq -col x y = (\_ -> Element "col" x y) - -col' :: Sig s opq -col' = Element "col" - -col_ :: AFSig_ s opq -col_ x = (\_ -> Element "col" dats x) - -col'_ :: Sig_ s opq -col'_ x = Element "col" dats x - -col__ :: AFSig__ s opq -col__ x = (\_ -> Element "col" dats [txt x]) - -col'__ :: Sig__ s opq -col'__ x = Element "col" dats [txt x] - - -colgroup :: AFSig s opq -colgroup x y = (\_ -> Element "colgroup" x y) - -colgroup' :: Sig s opq -colgroup' = Element "colgroup" - -colgroup_ :: AFSig_ s opq -colgroup_ x = (\_ -> Element "colgroup" dats x) - -colgroup'_ :: Sig_ s opq -colgroup'_ x = Element "colgroup" dats x - -colgroup__ :: AFSig__ s opq -colgroup__ x = (\_ -> Element "colgroup" dats [txt x]) - -colgroup'__ :: Sig__ s opq -colgroup'__ x = Element "colgroup" dats [txt x] - - -_data :: AFSig s opq -_data x y = (\_ -> Element "_data" x y) - -_data' :: Sig s opq -_data' = Element "_data" - -_data_ :: AFSig_ s opq -_data_ x = (\_ -> Element "_data" dats x) - -_data'_ :: Sig_ s opq -_data'_ x = Element "_data" dats x - -_data__ :: AFSig__ s opq -_data__ x = (\_ -> Element "_data" dats [txt x]) - -_data'__ :: Sig__ s opq -_data'__ x = Element "_data" dats [txt x] - - -_datalist :: AFSig s opq -_datalist x y = (\_ -> Element "_datalist" x y) - -_datalist' :: Sig s opq -_datalist' = Element "_datalist" - -_datalist_ :: AFSig_ s opq -_datalist_ x = (\_ -> Element "_datalist" dats x) - -_datalist'_ :: Sig_ s opq -_datalist'_ x = Element "_datalist" dats x - -_datalist__ :: AFSig__ s opq -_datalist__ x = (\_ -> Element "_datalist" dats [txt x]) - -_datalist'__ :: Sig__ s opq -_datalist'__ x = Element "_datalist" dats [txt x] - - -dd :: AFSig s opq -dd x y = (\_ -> Element "dd" x y) - -dd' :: Sig s opq -dd' = Element "dd" - -dd_ :: AFSig_ s opq -dd_ x = (\_ -> Element "dd" dats x) - -dd'_ :: Sig_ s opq -dd'_ x = Element "dd" dats x - -dd__ :: AFSig__ s opq -dd__ x = (\_ -> Element "dd" dats [txt x]) - -dd'__ :: Sig__ s opq -dd'__ x = Element "dd" dats [txt x] - - -del :: AFSig s opq -del x y = (\_ -> Element "del" x y) - -del' :: Sig s opq -del' = Element "del" - -del_ :: AFSig_ s opq -del_ x = (\_ -> Element "del" dats x) - -del'_ :: Sig_ s opq -del'_ x = Element "del" dats x - -del__ :: AFSig__ s opq -del__ x = (\_ -> Element "del" dats [txt x]) - -del'__ :: Sig__ s opq -del'__ x = Element "del" dats [txt x] - - -details :: AFSig s opq -details x y = (\_ -> Element "details" x y) - -details' :: Sig s opq -details' = Element "details" - -details_ :: AFSig_ s opq -details_ x = (\_ -> Element "details" dats x) - -details'_ :: Sig_ s opq -details'_ x = Element "details" dats x - -details__ :: AFSig__ s opq -details__ x = (\_ -> Element "details" dats [txt x]) - -details'__ :: Sig__ s opq -details'__ x = Element "details" dats [txt x] - - -dfn :: AFSig s opq -dfn x y = (\_ -> Element "dfn" x y) - -dfn' :: Sig s opq -dfn' = Element "dfn" - -dfn_ :: AFSig_ s opq -dfn_ x = (\_ -> Element "dfn" dats x) - -dfn'_ :: Sig_ s opq -dfn'_ x = Element "dfn" dats x - -dfn__ :: AFSig__ s opq -dfn__ x = (\_ -> Element "dfn" dats [txt x]) - -dfn'__ :: Sig__ s opq -dfn'__ x = Element "dfn" dats [txt x] - - -dialog :: AFSig s opq -dialog x y = (\_ -> Element "dialog" x y) - -dialog' :: Sig s opq -dialog' = Element "dialog" - -dialog_ :: AFSig_ s opq -dialog_ x = (\_ -> Element "dialog" dats x) - -dialog'_ :: Sig_ s opq -dialog'_ x = Element "dialog" dats x - -dialog__ :: AFSig__ s opq -dialog__ x = (\_ -> Element "dialog" dats [txt x]) - -dialog'__ :: Sig__ s opq -dialog'__ x = Element "dialog" dats [txt x] - - -dir :: AFSig s opq -dir x y = (\_ -> Element "dir" x y) - -dir' :: Sig s opq -dir' = Element "dir" - -dir_ :: AFSig_ s opq -dir_ x = (\_ -> Element "dir" dats x) - -dir'_ :: Sig_ s opq -dir'_ x = Element "dir" dats x - -dir__ :: AFSig__ s opq -dir__ x = (\_ -> Element "dir" dats [txt x]) - -dir'__ :: Sig__ s opq -dir'__ x = Element "dir" dats [txt x] - - -div :: AFSig s opq -div x y = (\_ -> Element "div" x y) - -div' :: Sig s opq -div' = Element "div" - -div_ :: AFSig_ s opq -div_ x = (\_ -> Element "div" dats x) - -div'_ :: Sig_ s opq -div'_ x = Element "div" dats x - -div__ :: AFSig__ s opq -div__ x = (\_ -> Element "div" dats [txt x]) - -div'__ :: Sig__ s opq -div'__ x = Element "div" dats [txt x] - - -dl :: AFSig s opq -dl x y = (\_ -> Element "dl" x y) - -dl' :: Sig s opq -dl' = Element "dl" - -dl_ :: AFSig_ s opq -dl_ x = (\_ -> Element "dl" dats x) - -dl'_ :: Sig_ s opq -dl'_ x = Element "dl" dats x - -dl__ :: AFSig__ s opq -dl__ x = (\_ -> Element "dl" dats [txt x]) - -dl'__ :: Sig__ s opq -dl'__ x = Element "dl" dats [txt x] - - -dt :: AFSig s opq -dt x y = (\_ -> Element "dt" x y) - -dt' :: Sig s opq -dt' = Element "dt" - -dt_ :: AFSig_ s opq -dt_ x = (\_ -> Element "dt" dats x) - -dt'_ :: Sig_ s opq -dt'_ x = Element "dt" dats x - -dt__ :: AFSig__ s opq -dt__ x = (\_ -> Element "dt" dats [txt x]) - -dt'__ :: Sig__ s opq -dt'__ x = Element "dt" dats [txt x] - - -em :: AFSig s opq -em x y = (\_ -> Element "em" x y) - -em' :: Sig s opq -em' = Element "em" - -em_ :: AFSig_ s opq -em_ x = (\_ -> Element "em" dats x) - -em'_ :: Sig_ s opq -em'_ x = Element "em" dats x - -em__ :: AFSig__ s opq -em__ x = (\_ -> Element "em" dats [txt x]) - -em'__ :: Sig__ s opq -em'__ x = Element "em" dats [txt x] - - -embed :: AFSig s opq -embed x y = (\_ -> Element "embed" x y) - -embed' :: Sig s opq -embed' = Element "embed" - -embed_ :: AFSig_ s opq -embed_ x = (\_ -> Element "embed" dats x) - -embed'_ :: Sig_ s opq -embed'_ x = Element "embed" dats x - -embed__ :: AFSig__ s opq -embed__ x = (\_ -> Element "embed" dats [txt x]) - -embed'__ :: Sig__ s opq -embed'__ x = Element "embed" dats [txt x] - - -fieldset :: AFSig s opq -fieldset x y = (\_ -> Element "fieldset" x y) - -fieldset' :: Sig s opq -fieldset' = Element "fieldset" - -fieldset_ :: AFSig_ s opq -fieldset_ x = (\_ -> Element "fieldset" dats x) - -fieldset'_ :: Sig_ s opq -fieldset'_ x = Element "fieldset" dats x - -fieldset__ :: AFSig__ s opq -fieldset__ x = (\_ -> Element "fieldset" dats [txt x]) - -fieldset'__ :: Sig__ s opq -fieldset'__ x = Element "fieldset" dats [txt x] - - -figcaption :: AFSig s opq -figcaption x y = (\_ -> Element "figcaption" x y) - -figcaption' :: Sig s opq -figcaption' = Element "figcaption" - -figcaption_ :: AFSig_ s opq -figcaption_ x = (\_ -> Element "figcaption" dats x) - -figcaption'_ :: Sig_ s opq -figcaption'_ x = Element "figcaption" dats x - -figcaption__ :: AFSig__ s opq -figcaption__ x = (\_ -> Element "figcaption" dats [txt x]) - -figcaption'__ :: Sig__ s opq -figcaption'__ x = Element "figcaption" dats [txt x] - - -figure :: AFSig s opq -figure x y = (\_ -> Element "figure" x y) - -figure' :: Sig s opq -figure' = Element "figure" - -figure_ :: AFSig_ s opq -figure_ x = (\_ -> Element "figure" dats x) - -figure'_ :: Sig_ s opq -figure'_ x = Element "figure" dats x - -figure__ :: AFSig__ s opq -figure__ x = (\_ -> Element "figure" dats [txt x]) - -figure'__ :: Sig__ s opq -figure'__ x = Element "figure" dats [txt x] - - -font :: AFSig s opq -font x y = (\_ -> Element "font" x y) - -font' :: Sig s opq -font' = Element "font" - -font_ :: AFSig_ s opq -font_ x = (\_ -> Element "font" dats x) - -font'_ :: Sig_ s opq -font'_ x = Element "font" dats x - -font__ :: AFSig__ s opq -font__ x = (\_ -> Element "font" dats [txt x]) - -font'__ :: Sig__ s opq -font'__ x = Element "font" dats [txt x] - - -footer :: AFSig s opq -footer x y = (\_ -> Element "footer" x y) - -footer' :: Sig s opq -footer' = Element "footer" - -footer_ :: AFSig_ s opq -footer_ x = (\_ -> Element "footer" dats x) - -footer'_ :: Sig_ s opq -footer'_ x = Element "footer" dats x - -footer__ :: AFSig__ s opq -footer__ x = (\_ -> Element "footer" dats [txt x]) - -footer'__ :: Sig__ s opq -footer'__ x = Element "footer" dats [txt x] - - -form :: AFSig s opq -form x y = (\_ -> Element "form" x y) - -form' :: Sig s opq -form' = Element "form" - -form_ :: AFSig_ s opq -form_ x = (\_ -> Element "form" dats x) - -form'_ :: Sig_ s opq -form'_ x = Element "form" dats x - -form__ :: AFSig__ s opq -form__ x = (\_ -> Element "form" dats [txt x]) - -form'__ :: Sig__ s opq -form'__ x = Element "form" dats [txt x] - - -frame :: AFSig s opq -frame x y = (\_ -> Element "frame" x y) - -frame' :: Sig s opq -frame' = Element "frame" - -frame_ :: AFSig_ s opq -frame_ x = (\_ -> Element "frame" dats x) - -frame'_ :: Sig_ s opq -frame'_ x = Element "frame" dats x - -frame__ :: AFSig__ s opq -frame__ x = (\_ -> Element "frame" dats [txt x]) - -frame'__ :: Sig__ s opq -frame'__ x = Element "frame" dats [txt x] - - -frameset :: AFSig s opq -frameset x y = (\_ -> Element "frameset" x y) - -frameset' :: Sig s opq -frameset' = Element "frameset" - -frameset_ :: AFSig_ s opq -frameset_ x = (\_ -> Element "frameset" dats x) - -frameset'_ :: Sig_ s opq -frameset'_ x = Element "frameset" dats x - -frameset__ :: AFSig__ s opq -frameset__ x = (\_ -> Element "frameset" dats [txt x]) - -frameset'__ :: Sig__ s opq -frameset'__ x = Element "frameset" dats [txt x] - -head :: AFSig s opq -head x y = (\_ -> Element "head" x y) - -head' :: Sig s opq -head' = Element "head" - -head_ :: AFSig_ s opq -head_ x = (\_ -> Element "head" dats x) - -head'_ :: Sig_ s opq -head'_ x = Element "head" dats x - -head__ :: AFSig__ s opq -head__ x = (\_ -> Element "head" dats [txt x]) - -head'__ :: Sig__ s opq -head'__ x = Element "head" dats [txt x] - - -header :: AFSig s opq -header x y = (\_ -> Element "header" x y) - -header' :: Sig s opq -header' = Element "header" - -header_ :: AFSig_ s opq -header_ x = (\_ -> Element "header" dats x) - -header'_ :: Sig_ s opq -header'_ x = Element "header" dats x - -header__ :: AFSig__ s opq -header__ x = (\_ -> Element "header" dats [txt x]) - -header'__ :: Sig__ s opq -header'__ x = Element "header" dats [txt x] - - -hr :: (s -> Node s opq) -hr = (\_ -> Element "br" dats []) - -html :: AFSig s opq -html x y = (\_ -> Element "html" x y) - -html' :: Sig s opq -html' = Element "html" - -html_ :: AFSig_ s opq -html_ x = (\_ -> Element "html" dats x) - -html'_ :: Sig_ s opq -html'_ x = Element "html" dats x - -html__ :: AFSig__ s opq -html__ x = (\_ -> Element "html" dats [txt x]) - -html'__ :: Sig__ s opq -html'__ x = Element "html" dats [txt x] - - -i :: AFSig s opq -i x y = (\_ -> Element "i" x y) - -i' :: Sig s opq -i' = Element "i" - -i_ :: AFSig_ s opq -i_ x = (\_ -> Element "i" dats x) - -i'_ :: Sig_ s opq -i'_ x = Element "i" dats x - -i__ :: AFSig__ s opq -i__ x = (\_ -> Element "i" dats [txt x]) - -i'__ :: Sig__ s opq -i'__ x = Element "i" dats [txt x] - - -iframe :: AFSig s opq -iframe x y = (\_ -> Element "iframe" x y) - -iframe' :: Sig s opq -iframe' = Element "iframe" - -iframe_ :: AFSig_ s opq -iframe_ x = (\_ -> Element "iframe" dats x) - -iframe'_ :: Sig_ s opq -iframe'_ x = Element "iframe" dats x - -iframe__ :: AFSig__ s opq -iframe__ x = (\_ -> Element "iframe" dats [txt x]) - -iframe'__ :: Sig__ s opq -iframe'__ x = Element "iframe" dats [txt x] - - -img :: (s -> Attributes s opq) -> (s -> Node s opq) -img x = (\_ -> Element "img" x []) - -img' :: (s -> Attributes s opq) -> Node s opq -img' x = Element "img" x [] - -img_ :: (s -> Node s opq) -img_ = (\_ -> Element "img" dats []) - -img'_ :: Node s opq -img'_ = Element "img" dats [] - -input :: AFSig s opq -input x y = (\_ -> Element "input" x y) - -input' :: Sig s opq -input' = Element "input" - -input_ :: AFSig_ s opq -input_ x = (\_ -> Element "input" dats x) - -input'_ :: Sig_ s opq -input'_ x = Element "input" dats x - -input__ :: AFSig__ s opq -input__ x = (\_ -> Element "input" dats [txt x]) - -input'__ :: Sig__ s opq -input'__ x = Element "input" dats [txt x] - - -ins :: AFSig s opq -ins x y = (\_ -> Element "ins" x y) - -ins' :: Sig s opq -ins' = Element "ins" - -ins_ :: AFSig_ s opq -ins_ x = (\_ -> Element "ins" dats x) - -ins'_ :: Sig_ s opq -ins'_ x = Element "ins" dats x - -ins__ :: AFSig__ s opq -ins__ x = (\_ -> Element "ins" dats [txt x]) - -ins'__ :: Sig__ s opq -ins'__ x = Element "ins" dats [txt x] - - -kbd :: AFSig s opq -kbd x y = (\_ -> Element "kbd" x y) - -kbd' :: Sig s opq -kbd' = Element "kbd" - -kbd_ :: AFSig_ s opq -kbd_ x = (\_ -> Element "kbd" dats x) - -kbd'_ :: Sig_ s opq -kbd'_ x = Element "kbd" dats x - -kbd__ :: AFSig__ s opq -kbd__ x = (\_ -> Element "kbd" dats [txt x]) - -kbd'__ :: Sig__ s opq -kbd'__ x = Element "kbd" dats [txt x] - - -label :: AFSig s opq -label x y = (\_ -> Element "label" x y) - -label' :: Sig s opq -label' = Element "label" - -label_ :: AFSig_ s opq -label_ x = (\_ -> Element "label" dats x) - -label'_ :: Sig_ s opq -label'_ x = Element "label" dats x - -label__ :: AFSig__ s opq -label__ x = (\_ -> Element "label" dats [txt x]) - -label'__ :: Sig__ s opq -label'__ x = Element "label" dats [txt x] - - -legend :: AFSig s opq -legend x y = (\_ -> Element "legend" x y) - -legend' :: Sig s opq -legend' = Element "legend" - -legend_ :: AFSig_ s opq -legend_ x = (\_ -> Element "legend" dats x) - -legend'_ :: Sig_ s opq -legend'_ x = Element "legend" dats x - -legend__ :: AFSig__ s opq -legend__ x = (\_ -> Element "legend" dats [txt x]) - -legend'__ :: Sig__ s opq -legend'__ x = Element "legend" dats [txt x] - - -li :: AFSig s opq -li x y = (\_ -> Element "li" x y) - -li' :: Sig s opq -li' = Element "li" - -li_ :: AFSig_ s opq -li_ x = (\_ -> Element "li" dats x) - -li'_ :: Sig_ s opq -li'_ x = Element "li" dats x - -li__ :: AFSig__ s opq -li__ x = (\_ -> Element "li" dats [txt x]) - -li'__ :: Sig__ s opq -li'__ x = Element "li" dats [txt x] - - -link :: AFSig s opq -link x y = (\_ -> Element "link" x y) - -link' :: Sig s opq -link' = Element "link" - -link_ :: AFSig_ s opq -link_ x = (\_ -> Element "link" dats x) - -link'_ :: Sig_ s opq -link'_ x = Element "link" dats x - -link__ :: AFSig__ s opq -link__ x = (\_ -> Element "link" dats [txt x]) - -link'__ :: Sig__ s opq -link'__ x = Element "link" dats [txt x] - - -main :: AFSig s opq -main x y = (\_ -> Element "main" x y) - -main' :: Sig s opq -main' = Element "main" - -main_ :: AFSig_ s opq -main_ x = (\_ -> Element "main" dats x) - -main'_ :: Sig_ s opq -main'_ x = Element "main" dats x - -main__ :: AFSig__ s opq -main__ x = (\_ -> Element "main" dats [txt x]) - -main'__ :: Sig__ s opq -main'__ x = Element "main" dats [txt x] - - -map :: AFSig s opq -map x y = (\_ -> Element "map" x y) - -map' :: Sig s opq -map' = Element "map" - -map_ :: AFSig_ s opq -map_ x = (\_ -> Element "map" dats x) - -map'_ :: Sig_ s opq -map'_ x = Element "map" dats x - -map__ :: AFSig__ s opq -map__ x = (\_ -> Element "map" dats [txt x]) - -map'__ :: Sig__ s opq -map'__ x = Element "map" dats [txt x] - - -mark :: AFSig s opq -mark x y = (\_ -> Element "mark" x y) - -mark' :: Sig s opq -mark' = Element "mark" - -mark_ :: AFSig_ s opq -mark_ x = (\_ -> Element "mark" dats x) - -mark'_ :: Sig_ s opq -mark'_ x = Element "mark" dats x - -mark__ :: AFSig__ s opq -mark__ x = (\_ -> Element "mark" dats [txt x]) - -mark'__ :: Sig__ s opq -mark'__ x = Element "mark" dats [txt x] - - -meta :: AFSig s opq -meta x y = (\_ -> Element "meta" x y) - -meta' :: Sig s opq -meta' = Element "meta" - -meta_ :: AFSig_ s opq -meta_ x = (\_ -> Element "meta" dats x) - -meta'_ :: Sig_ s opq -meta'_ x = Element "meta" dats x - -meta__ :: AFSig__ s opq -meta__ x = (\_ -> Element "meta" dats [txt x]) - -meta'__ :: Sig__ s opq -meta'__ x = Element "meta" dats [txt x] - - -meter :: AFSig s opq -meter x y = (\_ -> Element "meter" x y) - -meter' :: Sig s opq -meter' = Element "meter" - -meter_ :: AFSig_ s opq -meter_ x = (\_ -> Element "meter" dats x) - -meter'_ :: Sig_ s opq -meter'_ x = Element "meter" dats x - -meter__ :: AFSig__ s opq -meter__ x = (\_ -> Element "meter" dats [txt x]) - -meter'__ :: Sig__ s opq -meter'__ x = Element "meter" dats [txt x] - - -nav :: AFSig s opq -nav x y = (\_ -> Element "nav" x y) - -nav' :: Sig s opq -nav' = Element "nav" - -nav_ :: AFSig_ s opq -nav_ x = (\_ -> Element "nav" dats x) - -nav'_ :: Sig_ s opq -nav'_ x = Element "nav" dats x - -nav__ :: AFSig__ s opq -nav__ x = (\_ -> Element "nav" dats [txt x]) - -nav'__ :: Sig__ s opq -nav'__ x = Element "nav" dats [txt x] - - -noframes :: AFSig s opq -noframes x y = (\_ -> Element "noframes" x y) - -noframes' :: Sig s opq -noframes' = Element "noframes" - -noframes_ :: AFSig_ s opq -noframes_ x = (\_ -> Element "noframes" dats x) - -noframes'_ :: Sig_ s opq -noframes'_ x = Element "noframes" dats x - -noframes__ :: AFSig__ s opq -noframes__ x = (\_ -> Element "noframes" dats [txt x]) - -noframes'__ :: Sig__ s opq -noframes'__ x = Element "noframes" dats [txt x] - - -noscript :: AFSig s opq -noscript x y = (\_ -> Element "noscript" x y) - -noscript' :: Sig s opq -noscript' = Element "noscript" - -noscript_ :: AFSig_ s opq -noscript_ x = (\_ -> Element "noscript" dats x) - -noscript'_ :: Sig_ s opq -noscript'_ x = Element "noscript" dats x - -noscript__ :: AFSig__ s opq -noscript__ x = (\_ -> Element "noscript" dats [txt x]) - -noscript'__ :: Sig__ s opq -noscript'__ x = Element "noscript" dats [txt x] - - -object :: AFSig s opq -object x y = (\_ -> Element "object" x y) - -object' :: Sig s opq -object' = Element "object" - -object_ :: AFSig_ s opq -object_ x = (\_ -> Element "object" dats x) - -object'_ :: Sig_ s opq -object'_ x = Element "object" dats x - -object__ :: AFSig__ s opq -object__ x = (\_ -> Element "object" dats [txt x]) - -object'__ :: Sig__ s opq -object'__ x = Element "object" dats [txt x] - - -ol :: AFSig s opq -ol x y = (\_ -> Element "ol" x y) - -ol' :: Sig s opq -ol' = Element "ol" - -ol_ :: AFSig_ s opq -ol_ x = (\_ -> Element "ol" dats x) - -ol'_ :: Sig_ s opq -ol'_ x = Element "ol" dats x - -ol__ :: AFSig__ s opq -ol__ x = (\_ -> Element "ol" dats [txt x]) - -ol'__ :: Sig__ s opq -ol'__ x = Element "ol" dats [txt x] - - -optgroup :: AFSig s opq -optgroup x y = (\_ -> Element "optgroup" x y) - -optgroup' :: Sig s opq -optgroup' = Element "optgroup" - -optgroup_ :: AFSig_ s opq -optgroup_ x = (\_ -> Element "optgroup" dats x) - -optgroup'_ :: Sig_ s opq -optgroup'_ x = Element "optgroup" dats x - -optgroup__ :: AFSig__ s opq -optgroup__ x = (\_ -> Element "optgroup" dats [txt x]) - -optgroup'__ :: Sig__ s opq -optgroup'__ x = Element "optgroup" dats [txt x] - - -option :: AFSig s opq -option x y = (\_ -> Element "option" x y) - -option' :: Sig s opq -option' = Element "option" - -option_ :: AFSig_ s opq -option_ x = (\_ -> Element "option" dats x) - -option'_ :: Sig_ s opq -option'_ x = Element "option" dats x - -option__ :: AFSig__ s opq -option__ x = (\_ -> Element "option" dats [txt x]) - -option'__ :: Sig__ s opq -option'__ x = Element "option" dats [txt x] - - -output :: AFSig s opq -output x y = (\_ -> Element "output" x y) - -output' :: Sig s opq -output' = Element "output" - -output_ :: AFSig_ s opq -output_ x = (\_ -> Element "output" dats x) - -output'_ :: Sig_ s opq -output'_ x = Element "output" dats x - -output__ :: AFSig__ s opq -output__ x = (\_ -> Element "output" dats [txt x]) - -output'__ :: Sig__ s opq -output'__ x = Element "output" dats [txt x] - - -p :: AFSig s opq -p x y = (\_ -> Element "p" x y) - -p' :: Sig s opq -p' = Element "p" - -p_ :: AFSig_ s opq -p_ x = (\_ -> Element "p" dats x) - -p'_ :: Sig_ s opq -p'_ x = Element "p" dats x - -p__ :: AFSig__ s opq -p__ x = (\_ -> Element "p" dats [txt x]) - -p'__ :: Sig__ s opq -p'__ x = Element "p" dats [txt x] - - -param :: AFSig s opq -param x y = (\_ -> Element "param" x y) - -param' :: Sig s opq -param' = Element "param" - -param_ :: AFSig_ s opq -param_ x = (\_ -> Element "param" dats x) - -param'_ :: Sig_ s opq -param'_ x = Element "param" dats x - -param__ :: AFSig__ s opq -param__ x = (\_ -> Element "param" dats [txt x]) - -param'__ :: Sig__ s opq -param'__ x = Element "param" dats [txt x] - - -picture :: AFSig s opq -picture x y = (\_ -> Element "picture" x y) - -picture' :: Sig s opq -picture' = Element "picture" - -picture_ :: AFSig_ s opq -picture_ x = (\_ -> Element "picture" dats x) - -picture'_ :: Sig_ s opq -picture'_ x = Element "picture" dats x - -picture__ :: AFSig__ s opq -picture__ x = (\_ -> Element "picture" dats [txt x]) - -picture'__ :: Sig__ s opq -picture'__ x = Element "picture" dats [txt x] - - -pre :: AFSig s opq -pre x y = (\_ -> Element "pre" x y) - -pre' :: Sig s opq -pre' = Element "pre" - -pre_ :: AFSig_ s opq -pre_ x = (\_ -> Element "pre" dats x) - -pre'_ :: Sig_ s opq -pre'_ x = Element "pre" dats x - -pre__ :: AFSig__ s opq -pre__ x = (\_ -> Element "pre" dats [txt x]) - -pre'__ :: Sig__ s opq -pre'__ x = Element "pre" dats [txt x] - - -progress :: AFSig s opq -progress x y = (\_ -> Element "progress" x y) - -progress' :: Sig s opq -progress' = Element "progress" - -progress_ :: AFSig_ s opq -progress_ x = (\_ -> Element "progress" dats x) - -progress'_ :: Sig_ s opq -progress'_ x = Element "progress" dats x - -progress__ :: AFSig__ s opq -progress__ x = (\_ -> Element "progress" dats [txt x]) - -progress'__ :: Sig__ s opq -progress'__ x = Element "progress" dats [txt x] - - -q :: AFSig s opq -q x y = (\_ -> Element "q" x y) - -q' :: Sig s opq -q' = Element "q" - -q_ :: AFSig_ s opq -q_ x = (\_ -> Element "q" dats x) - -q'_ :: Sig_ s opq -q'_ x = Element "q" dats x - -q__ :: AFSig__ s opq -q__ x = (\_ -> Element "q" dats [txt x]) - -q'__ :: Sig__ s opq -q'__ x = Element "q" dats [txt x] - - -rp :: AFSig s opq -rp x y = (\_ -> Element "rp" x y) - -rp' :: Sig s opq -rp' = Element "rp" - -rp_ :: AFSig_ s opq -rp_ x = (\_ -> Element "rp" dats x) - -rp'_ :: Sig_ s opq -rp'_ x = Element "rp" dats x - -rp__ :: AFSig__ s opq -rp__ x = (\_ -> Element "rp" dats [txt x]) - -rp'__ :: Sig__ s opq -rp'__ x = Element "rp" dats [txt x] - - -rt :: AFSig s opq -rt x y = (\_ -> Element "rt" x y) - -rt' :: Sig s opq -rt' = Element "rt" - -rt_ :: AFSig_ s opq -rt_ x = (\_ -> Element "rt" dats x) - -rt'_ :: Sig_ s opq -rt'_ x = Element "rt" dats x - -rt__ :: AFSig__ s opq -rt__ x = (\_ -> Element "rt" dats [txt x]) - -rt'__ :: Sig__ s opq -rt'__ x = Element "rt" dats [txt x] - - -ruby :: AFSig s opq -ruby x y = (\_ -> Element "ruby" x y) - -ruby' :: Sig s opq -ruby' = Element "ruby" - -ruby_ :: AFSig_ s opq -ruby_ x = (\_ -> Element "ruby" dats x) - -ruby'_ :: Sig_ s opq -ruby'_ x = Element "ruby" dats x - -ruby__ :: AFSig__ s opq -ruby__ x = (\_ -> Element "ruby" dats [txt x]) - -ruby'__ :: Sig__ s opq -ruby'__ x = Element "ruby" dats [txt x] - - -s :: AFSig s opq -s x y = (\_ -> Element "s" x y) - -s' :: Sig s opq -s' = Element "s" - -s_ :: AFSig_ s opq -s_ x = (\_ -> Element "s" dats x) - -s'_ :: Sig_ s opq -s'_ x = Element "s" dats x - -s__ :: AFSig__ s opq -s__ x = (\_ -> Element "s" dats [txt x]) - -s'__ :: Sig__ s opq -s'__ x = Element "s" dats [txt x] - - -samp :: AFSig s opq -samp x y = (\_ -> Element "samp" x y) - -samp' :: Sig s opq -samp' = Element "samp" - -samp_ :: AFSig_ s opq -samp_ x = (\_ -> Element "samp" dats x) - -samp'_ :: Sig_ s opq -samp'_ x = Element "samp" dats x - -samp__ :: AFSig__ s opq -samp__ x = (\_ -> Element "samp" dats [txt x]) - -samp'__ :: Sig__ s opq -samp'__ x = Element "samp" dats [txt x] - - -script :: AFSig s opq -script x y = (\_ -> Element "script" x y) - -script' :: Sig s opq -script' = Element "script" - -script_ :: AFSig_ s opq -script_ x = (\_ -> Element "script" dats x) - -script'_ :: Sig_ s opq -script'_ x = Element "script" dats x - -script__ :: AFSig__ s opq -script__ x = (\_ -> Element "script" dats [txt x]) - -script'__ :: Sig__ s opq -script'__ x = Element "script" dats [txt x] - - -section :: AFSig s opq -section x y = (\_ -> Element "section" x y) - -section' :: Sig s opq -section' = Element "section" - -section_ :: AFSig_ s opq -section_ x = (\_ -> Element "section" dats x) - -section'_ :: Sig_ s opq -section'_ x = Element "section" dats x - -section__ :: AFSig__ s opq -section__ x = (\_ -> Element "section" dats [txt x]) - -section'__ :: Sig__ s opq -section'__ x = Element "section" dats [txt x] - - -select :: AFSig s opq -select x y = (\_ -> Element "select" x y) - -select' :: Sig s opq -select' = Element "select" - -select_ :: AFSig_ s opq -select_ x = (\_ -> Element "select" dats x) - -select'_ :: Sig_ s opq -select'_ x = Element "select" dats x - -select__ :: AFSig__ s opq -select__ x = (\_ -> Element "select" dats [txt x]) - -select'__ :: Sig__ s opq -select'__ x = Element "select" dats [txt x] - - -small :: AFSig s opq -small x y = (\_ -> Element "small" x y) - -small' :: Sig s opq -small' = Element "small" - -small_ :: AFSig_ s opq -small_ x = (\_ -> Element "small" dats x) - -small'_ :: Sig_ s opq -small'_ x = Element "small" dats x - -small__ :: AFSig__ s opq -small__ x = (\_ -> Element "small" dats [txt x]) - -small'__ :: Sig__ s opq -small'__ x = Element "small" dats [txt x] - - -source :: AFSig s opq -source x y = (\_ -> Element "source" x y) - -source' :: Sig s opq -source' = Element "source" - -source_ :: AFSig_ s opq -source_ x = (\_ -> Element "source" dats x) - -source'_ :: Sig_ s opq -source'_ x = Element "source" dats x - -source__ :: AFSig__ s opq -source__ x = (\_ -> Element "source" dats [txt x]) - -source'__ :: Sig__ s opq -source'__ x = Element "source" dats [txt x] - - -span :: AFSig s opq -span x y = (\_ -> Element "span" x y) - -span' :: Sig s opq -span' = Element "span" - -span_ :: AFSig_ s opq -span_ x = (\_ -> Element "span" dats x) - -span'_ :: Sig_ s opq -span'_ x = Element "span" dats x - -span__ :: AFSig__ s opq -span__ x = (\_ -> Element "span" dats [txt x]) - -span'__ :: Sig__ s opq -span'__ x = Element "span" dats [txt x] - - -strike :: AFSig s opq -strike x y = (\_ -> Element "strike" x y) - -strike' :: Sig s opq -strike' = Element "strike" - -strike_ :: AFSig_ s opq -strike_ x = (\_ -> Element "strike" dats x) - -strike'_ :: Sig_ s opq -strike'_ x = Element "strike" dats x - -strike__ :: AFSig__ s opq -strike__ x = (\_ -> Element "strike" dats [txt x]) - -strike'__ :: Sig__ s opq -strike'__ x = Element "strike" dats [txt x] - - -strong :: AFSig s opq -strong x y = (\_ -> Element "strong" x y) - -strong' :: Sig s opq -strong' = Element "strong" - -strong_ :: AFSig_ s opq -strong_ x = (\_ -> Element "strong" dats x) - -strong'_ :: Sig_ s opq -strong'_ x = Element "strong" dats x - -strong__ :: AFSig__ s opq -strong__ x = (\_ -> Element "strong" dats [txt x]) - -strong'__ :: Sig__ s opq -strong'__ x = Element "strong" dats [txt x] - - -style :: AFSig s opq -style x y = (\_ -> Element "style" x y) - -style' :: Sig s opq -style' = Element "style" - -style_ :: AFSig_ s opq -style_ x = (\_ -> Element "style" dats x) - -style'_ :: Sig_ s opq -style'_ x = Element "style" dats x - -style__ :: AFSig__ s opq -style__ x = (\_ -> Element "style" dats [txt x]) - -style'__ :: Sig__ s opq -style'__ x = Element "style" dats [txt x] - - -sub :: AFSig s opq -sub x y = (\_ -> Element "sub" x y) - -sub' :: Sig s opq -sub' = Element "sub" - -sub_ :: AFSig_ s opq -sub_ x = (\_ -> Element "sub" dats x) - -sub'_ :: Sig_ s opq -sub'_ x = Element "sub" dats x - -sub__ :: AFSig__ s opq -sub__ x = (\_ -> Element "sub" dats [txt x]) - -sub'__ :: Sig__ s opq -sub'__ x = Element "sub" dats [txt x] - - -summary :: AFSig s opq -summary x y = (\_ -> Element "summary" x y) - -summary' :: Sig s opq -summary' = Element "summary" - -summary_ :: AFSig_ s opq -summary_ x = (\_ -> Element "summary" dats x) - -summary'_ :: Sig_ s opq -summary'_ x = Element "summary" dats x - -summary__ :: AFSig__ s opq -summary__ x = (\_ -> Element "summary" dats [txt x]) - -summary'__ :: Sig__ s opq -summary'__ x = Element "summary" dats [txt x] - - -sup :: AFSig s opq -sup x y = (\_ -> Element "sup" x y) - -sup' :: Sig s opq -sup' = Element "sup" - -sup_ :: AFSig_ s opq -sup_ x = (\_ -> Element "sup" dats x) - -sup'_ :: Sig_ s opq -sup'_ x = Element "sup" dats x - -sup__ :: AFSig__ s opq -sup__ x = (\_ -> Element "sup" dats [txt x]) - -sup'__ :: Sig__ s opq -sup'__ x = Element "sup" dats [txt x] - - -svg :: AFSig s opq -svg x y = (\_ -> Element "svg" x y) - -svg' :: Sig s opq -svg' = Element "svg" - -svg_ :: AFSig_ s opq -svg_ x = (\_ -> Element "svg" dats x) - -svg'_ :: Sig_ s opq -svg'_ x = Element "svg" dats x - -svg__ :: AFSig__ s opq -svg__ x = (\_ -> Element "svg" dats [txt x]) - -svg'__ :: Sig__ s opq -svg'__ x = Element "svg" dats [txt x] - - -table :: AFSig s opq -table x y = (\_ -> Element "table" x y) - -table' :: Sig s opq -table' = Element "table" - -table_ :: AFSig_ s opq -table_ x = (\_ -> Element "table" dats x) - -table'_ :: Sig_ s opq -table'_ x = Element "table" dats x - -table__ :: AFSig__ s opq -table__ x = (\_ -> Element "table" dats [txt x]) - -table'__ :: Sig__ s opq -table'__ x = Element "table" dats [txt x] - - -tbody :: AFSig s opq -tbody x y = (\_ -> Element "tbody" x y) - -tbody' :: Sig s opq -tbody' = Element "tbody" - -tbody_ :: AFSig_ s opq -tbody_ x = (\_ -> Element "tbody" dats x) - -tbody'_ :: Sig_ s opq -tbody'_ x = Element "tbody" dats x - -tbody__ :: AFSig__ s opq -tbody__ x = (\_ -> Element "tbody" dats [txt x]) - -tbody'__ :: Sig__ s opq -tbody'__ x = Element "tbody" dats [txt x] - - -td :: AFSig s opq -td x y = (\_ -> Element "td" x y) - -td' :: Sig s opq -td' = Element "td" - -td_ :: AFSig_ s opq -td_ x = (\_ -> Element "td" dats x) - -td'_ :: Sig_ s opq -td'_ x = Element "td" dats x - -td__ :: AFSig__ s opq -td__ x = (\_ -> Element "td" dats [txt x]) - -td'__ :: Sig__ s opq -td'__ x = Element "td" dats [txt x] - - -template :: AFSig s opq -template x y = (\_ -> Element "template" x y) - -template' :: Sig s opq -template' = Element "template" - -template_ :: AFSig_ s opq -template_ x = (\_ -> Element "template" dats x) - -template'_ :: Sig_ s opq -template'_ x = Element "template" dats x - -template__ :: AFSig__ s opq -template__ x = (\_ -> Element "template" dats [txt x]) - -template'__ :: Sig__ s opq -template'__ x = Element "template" dats [txt x] - - -textarea :: AFSig s opq -textarea x y = (\_ -> Element "textarea" x y) - -textarea' :: Sig s opq -textarea' = Element "textarea" - -textarea_ :: AFSig_ s opq -textarea_ x = (\_ -> Element "textarea" dats x) - -textarea'_ :: Sig_ s opq -textarea'_ x = Element "textarea" dats x - -textarea__ :: AFSig__ s opq -textarea__ x = (\_ -> Element "textarea" dats [txt x]) - -textarea'__ :: Sig__ s opq -textarea'__ x = Element "textarea" dats [txt x] - - -tfoot :: AFSig s opq -tfoot x y = (\_ -> Element "tfoot" x y) - -tfoot' :: Sig s opq -tfoot' = Element "tfoot" - -tfoot_ :: AFSig_ s opq -tfoot_ x = (\_ -> Element "tfoot" dats x) - -tfoot'_ :: Sig_ s opq -tfoot'_ x = Element "tfoot" dats x - -tfoot__ :: AFSig__ s opq -tfoot__ x = (\_ -> Element "tfoot" dats [txt x]) - -tfoot'__ :: Sig__ s opq -tfoot'__ x = Element "tfoot" dats [txt x] - - -th :: AFSig s opq -th x y = (\_ -> Element "th" x y) - -th' :: Sig s opq -th' = Element "th" - -th_ :: AFSig_ s opq -th_ x = (\_ -> Element "th" dats x) - -th'_ :: Sig_ s opq -th'_ x = Element "th" dats x - -th__ :: AFSig__ s opq -th__ x = (\_ -> Element "th" dats [txt x]) - -th'__ :: Sig__ s opq -th'__ x = Element "th" dats [txt x] - - -thead :: AFSig s opq -thead x y = (\_ -> Element "thead" x y) - -thead' :: Sig s opq -thead' = Element "thead" - -thead_ :: AFSig_ s opq -thead_ x = (\_ -> Element "thead" dats x) - -thead'_ :: Sig_ s opq -thead'_ x = Element "thead" dats x - -thead__ :: AFSig__ s opq -thead__ x = (\_ -> Element "thead" dats [txt x]) - -thead'__ :: Sig__ s opq -thead'__ x = Element "thead" dats [txt x] - - -time :: AFSig s opq -time x y = (\_ -> Element "time" x y) - -time' :: Sig s opq -time' = Element "time" - -time_ :: AFSig_ s opq -time_ x = (\_ -> Element "time" dats x) - -time'_ :: Sig_ s opq -time'_ x = Element "time" dats x - -time__ :: AFSig__ s opq -time__ x = (\_ -> Element "time" dats [txt x]) - -time'__ :: Sig__ s opq -time'__ x = Element "time" dats [txt x] - - -title :: AFSig s opq -title x y = (\_ -> Element "title" x y) - -title' :: Sig s opq -title' = Element "title" - -title_ :: AFSig_ s opq -title_ x = (\_ -> Element "title" dats x) - -title'_ :: Sig_ s opq -title'_ x = Element "title" dats x - -title__ :: AFSig__ s opq -title__ x = (\_ -> Element "title" dats [txt x]) - -title'__ :: Sig__ s opq -title'__ x = Element "title" dats [txt x] - - -tr :: AFSig s opq -tr x y = (\_ -> Element "tr" x y) - -tr' :: Sig s opq -tr' = Element "tr" - -tr_ :: AFSig_ s opq -tr_ x = (\_ -> Element "tr" dats x) - -tr'_ :: Sig_ s opq -tr'_ x = Element "tr" dats x - -tr__ :: AFSig__ s opq -tr__ x = (\_ -> Element "tr" dats [txt x]) - -tr'__ :: Sig__ s opq -tr'__ x = Element "tr" dats [txt x] - - -track :: AFSig s opq -track x y = (\_ -> Element "track" x y) - -track' :: Sig s opq -track' = Element "track" - -track_ :: AFSig_ s opq -track_ x = (\_ -> Element "track" dats x) - -track'_ :: Sig_ s opq -track'_ x = Element "track" dats x - -track__ :: AFSig__ s opq -track__ x = (\_ -> Element "track" dats [txt x]) - -track'__ :: Sig__ s opq -track'__ x = Element "track" dats [txt x] - - -tt :: AFSig s opq -tt x y = (\_ -> Element "tt" x y) - -tt' :: Sig s opq -tt' = Element "tt" - -tt_ :: AFSig_ s opq -tt_ x = (\_ -> Element "tt" dats x) - -tt'_ :: Sig_ s opq -tt'_ x = Element "tt" dats x - -tt__ :: AFSig__ s opq -tt__ x = (\_ -> Element "tt" dats [txt x]) - -tt'__ :: Sig__ s opq -tt'__ x = Element "tt" dats [txt x] - - -u :: AFSig s opq -u x y = (\_ -> Element "u" x y) - -u' :: Sig s opq -u' = Element "u" - -u_ :: AFSig_ s opq -u_ x = (\_ -> Element "u" dats x) - -u'_ :: Sig_ s opq -u'_ x = Element "u" dats x - -u__ :: AFSig__ s opq -u__ x = (\_ -> Element "u" dats [txt x]) - -u'__ :: Sig__ s opq -u'__ x = Element "u" dats [txt x] - - -ul :: AFSig s opq -ul x y = (\_ -> Element "ul" x y) - -ul' :: Sig s opq -ul' = Element "ul" - -ul_ :: AFSig_ s opq -ul_ x = (\_ -> Element "ul" dats x) - -ul'_ :: Sig_ s opq -ul'_ x = Element "ul" dats x - -ul__ :: AFSig__ s opq -ul__ x = (\_ -> Element "ul" dats [txt x]) - -ul'__ :: Sig__ s opq -ul'__ x = Element "ul" dats [txt x] - - -var :: AFSig s opq -var x y = (\_ -> Element "var" x y) - -var' :: Sig s opq -var' = Element "var" - -var_ :: AFSig_ s opq -var_ x = (\_ -> Element "var" dats x) - -var'_ :: Sig_ s opq -var'_ x = Element "var" dats x - -var__ :: AFSig__ s opq -var__ x = (\_ -> Element "var" dats [txt x]) - -var'__ :: Sig__ s opq -var'__ x = Element "var" dats [txt x] - - -video :: AFSig s opq -video x y = (\_ -> Element "video" x y) - -video' :: Sig s opq -video' = Element "video" - -video_ :: AFSig_ s opq -video_ x = (\_ -> Element "video" dats x) - -video'_ :: Sig_ s opq -video'_ x = Element "video" dats x - -video__ :: AFSig__ s opq -video__ x = (\_ -> Element "video" dats [txt x]) - -video'__ :: Sig__ s opq -video'__ x = Element "video" dats [txt x] - - -wbr :: (s -> Node s opq) -wbr = (\_ -> Element "br" dats []) - -txt :: String -> (s -> Node s opq) -txt t = (\_ -> TextNode t) - -txt' :: String -> Node s opq -txt' = TextNode - - -h1 :: AFSig s opq -h1 x y = (\_ -> Element "h1" x y) - -h1' :: Sig s opq -h1' = Element "h1" - -h1_ :: AFSig_ s opq -h1_ x = (\_ -> Element "h1" dats x) - -h1'_ :: Sig_ s opq -h1'_ x = Element "h1" dats x - -h1__ :: AFSig__ s opq -h1__ x = (\_ -> Element "h1" dats [txt x]) - -h1'__ :: Sig__ s opq -h1'__ x = Element "h1" dats [txt x] - - -h2 :: AFSig s opq -h2 x y = (\_ -> Element "h2" x y) - -h2' :: Sig s opq -h2' = Element "h2" - -h2_ :: AFSig_ s opq -h2_ x = (\_ -> Element "h2" dats x) - -h2'_ :: Sig_ s opq -h2'_ x = Element "h2" dats x - -h2__ :: AFSig__ s opq -h2__ x = (\_ -> Element "h2" dats [txt x]) - -h2'__ :: Sig__ s opq -h2'__ x = Element "h2" dats [txt x] - - -h3 :: AFSig s opq -h3 x y = (\_ -> Element "h3" x y) - -h3' :: Sig s opq -h3' = Element "h3" - -h3_ :: AFSig_ s opq -h3_ x = (\_ -> Element "h3" dats x) - -h3'_ :: Sig_ s opq -h3'_ x = Element "h3" dats x - -h3__ :: AFSig__ s opq -h3__ x = (\_ -> Element "h3" dats [txt x]) - -h3'__ :: Sig__ s opq -h3'__ x = Element "h3" dats [txt x] - - -h4 :: AFSig s opq -h4 x y = (\_ -> Element "h4" x y) - -h4' :: Sig s opq -h4' = Element "h4" - -h4_ :: AFSig_ s opq -h4_ x = (\_ -> Element "h4" dats x) - -h4'_ :: Sig_ s opq -h4'_ x = Element "h4" dats x - -h4__ :: AFSig__ s opq -h4__ x = (\_ -> Element "h4" dats [txt x]) - -h4'__ :: Sig__ s opq -h4'__ x = Element "h4" dats [txt x] - - -h5 :: AFSig s opq -h5 x y = (\_ -> Element "h5" x y) - -h5' :: Sig s opq -h5' = Element "h5" - -h5_ :: AFSig_ s opq -h5_ x = (\_ -> Element "h5" dats x) - -h5'_ :: Sig_ s opq -h5'_ x = Element "h5" dats x - -h5__ :: AFSig__ s opq -h5__ x = (\_ -> Element "h5" dats [txt x]) - -h5'__ :: Sig__ s opq -h5'__ x = Element "h5" dats [txt x] - - -h6 :: AFSig s opq -h6 x y = (\_ -> Element "h6" x y) - -h6' :: Sig s opq -h6' = Element "h6" - -h6_ :: AFSig_ s opq -h6_ x = (\_ -> Element "h6" dats x) - -h6'_ :: Sig_ s opq -h6'_ x = Element "h6" dats x - -h6__ :: AFSig__ s opq -h6__ x = (\_ -> Element "h6" dats [txt x]) - -h6'__ :: Sig__ s opq -h6'__ x = Element "h6" dats [txt x] + = [(String, (s -> PwAttribute s opq))] -> [s -> PwNode s opq] -> (s -> PwNode s opq) +type Sig s opq = [(String, (s -> PwAttribute s opq))] -> [s -> PwNode s opq] -> PwNode s opq + +type AFSig_ s opq = [s -> PwNode s opq] -> (s -> PwNode s opq) +type Sig_ s opq = [s -> PwNode s opq] -> PwNode s opq + +type AFSig__ s opq = String -> (s -> PwNode s opq) +type Sig__ s opq = String -> PwNode s opq + + +a :: AFSig s opq +a x y = (\_ -> PwElement "a" x y) + +a' :: Sig s opq +a' = PwElement "a" + +a_ :: AFSig_ s opq +a_ x = (\_ -> PwElement "a" dats x) + +a'_ :: Sig_ s opq +a'_ x = PwElement "a" dats x + +a__ :: AFSig__ s opq +a__ x = (\_ -> PwElement "a" dats [txt x]) + +a'__ :: Sig__ s opq +a'__ x = PwElement "a" dats [txt x] + + +abbr :: AFSig s opq +abbr x y = (\_ -> PwElement "abbr" x y) + +abbr' :: Sig s opq +abbr' = PwElement "abbr" + +abbr_ :: AFSig_ s opq +abbr_ x = (\_ -> PwElement "abbr" dats x) + +abbr'_ :: Sig_ s opq +abbr'_ x = PwElement "abbr" dats x + +abbr__ :: AFSig__ s opq +abbr__ x = (\_ -> PwElement "abbr" dats [txt x]) + +abbr'__ :: Sig__ s opq +abbr'__ x = PwElement "abbr" dats [txt x] + + +acronym :: AFSig s opq +acronym x y = (\_ -> PwElement "acronym" x y) + +acronym' :: Sig s opq +acronym' = PwElement "acronym" + +acronym_ :: AFSig_ s opq +acronym_ x = (\_ -> PwElement "acronym" dats x) + +acronym'_ :: Sig_ s opq +acronym'_ x = PwElement "acronym" dats x + +acronym__ :: AFSig__ s opq +acronym__ x = (\_ -> PwElement "acronym" dats [txt x]) + +acronym'__ :: Sig__ s opq +acronym'__ x = PwElement "acronym" dats [txt x] + + +address :: AFSig s opq +address x y = (\_ -> PwElement "address" x y) + +address' :: Sig s opq +address' = PwElement "address" + +address_ :: AFSig_ s opq +address_ x = (\_ -> PwElement "address" dats x) + +address'_ :: Sig_ s opq +address'_ x = PwElement "address" dats x + +address__ :: AFSig__ s opq +address__ x = (\_ -> PwElement "address" dats [txt x]) + +address'__ :: Sig__ s opq +address'__ x = PwElement "address" dats [txt x] + + +applet :: AFSig s opq +applet x y = (\_ -> PwElement "applet" x y) + +applet' :: Sig s opq +applet' = PwElement "applet" + +applet_ :: AFSig_ s opq +applet_ x = (\_ -> PwElement "applet" dats x) + +applet'_ :: Sig_ s opq +applet'_ x = PwElement "applet" dats x + +applet__ :: AFSig__ s opq +applet__ x = (\_ -> PwElement "applet" dats [txt x]) + +applet'__ :: Sig__ s opq +applet'__ x = PwElement "applet" dats [txt x] + + +area :: AFSig s opq +area x y = (\_ -> PwElement "area" x y) + +area' :: Sig s opq +area' = PwElement "area" + +area_ :: AFSig_ s opq +area_ x = (\_ -> PwElement "area" dats x) + +area'_ :: Sig_ s opq +area'_ x = PwElement "area" dats x + +area__ :: AFSig__ s opq +area__ x = (\_ -> PwElement "area" dats [txt x]) + +area'__ :: Sig__ s opq +area'__ x = PwElement "area" dats [txt x] + + +article :: AFSig s opq +article x y = (\_ -> PwElement "article" x y) + +article' :: Sig s opq +article' = PwElement "article" + +article_ :: AFSig_ s opq +article_ x = (\_ -> PwElement "article" dats x) + +article'_ :: Sig_ s opq +article'_ x = PwElement "article" dats x + +article__ :: AFSig__ s opq +article__ x = (\_ -> PwElement "article" dats [txt x]) + +article'__ :: Sig__ s opq +article'__ x = PwElement "article" dats [txt x] + + +aside :: AFSig s opq +aside x y = (\_ -> PwElement "aside" x y) + +aside' :: Sig s opq +aside' = PwElement "aside" + +aside_ :: AFSig_ s opq +aside_ x = (\_ -> PwElement "aside" dats x) + +aside'_ :: Sig_ s opq +aside'_ x = PwElement "aside" dats x + +aside__ :: AFSig__ s opq +aside__ x = (\_ -> PwElement "aside" dats [txt x]) + +aside'__ :: Sig__ s opq +aside'__ x = PwElement "aside" dats [txt x] + + +audio :: AFSig s opq +audio x y = (\_ -> PwElement "audio" x y) + +audio' :: Sig s opq +audio' = PwElement "audio" + +audio_ :: AFSig_ s opq +audio_ x = (\_ -> PwElement "audio" dats x) + +audio'_ :: Sig_ s opq +audio'_ x = PwElement "audio" dats x + +audio__ :: AFSig__ s opq +audio__ x = (\_ -> PwElement "audio" dats [txt x]) + +audio'__ :: Sig__ s opq +audio'__ x = PwElement "audio" dats [txt x] + + +b :: AFSig s opq +b x y = (\_ -> PwElement "b" x y) + +b' :: Sig s opq +b' = PwElement "b" + +b_ :: AFSig_ s opq +b_ x = (\_ -> PwElement "b" dats x) + +b'_ :: Sig_ s opq +b'_ x = PwElement "b" dats x + +b__ :: AFSig__ s opq +b__ x = (\_ -> PwElement "b" dats [txt x]) + +b'__ :: Sig__ s opq +b'__ x = PwElement "b" dats [txt x] + + +base :: AFSig s opq +base x y = (\_ -> PwElement "base" x y) + +base' :: Sig s opq +base' = PwElement "base" + +base_ :: AFSig_ s opq +base_ x = (\_ -> PwElement "base" dats x) + +base'_ :: Sig_ s opq +base'_ x = PwElement "base" dats x + +base__ :: AFSig__ s opq +base__ x = (\_ -> PwElement "base" dats [txt x]) + +base'__ :: Sig__ s opq +base'__ x = PwElement "base" dats [txt x] + + +basefont :: AFSig s opq +basefont x y = (\_ -> PwElement "basefont" x y) + +basefont' :: Sig s opq +basefont' = PwElement "basefont" + +basefont_ :: AFSig_ s opq +basefont_ x = (\_ -> PwElement "basefont" dats x) + +basefont'_ :: Sig_ s opq +basefont'_ x = PwElement "basefont" dats x + +basefont__ :: AFSig__ s opq +basefont__ x = (\_ -> PwElement "basefont" dats [txt x]) + +basefont'__ :: Sig__ s opq +basefont'__ x = PwElement "basefont" dats [txt x] + + +bdi :: AFSig s opq +bdi x y = (\_ -> PwElement "bdi" x y) + +bdi' :: Sig s opq +bdi' = PwElement "bdi" + +bdi_ :: AFSig_ s opq +bdi_ x = (\_ -> PwElement "bdi" dats x) + +bdi'_ :: Sig_ s opq +bdi'_ x = PwElement "bdi" dats x + +bdi__ :: AFSig__ s opq +bdi__ x = (\_ -> PwElement "bdi" dats [txt x]) + +bdi'__ :: Sig__ s opq +bdi'__ x = PwElement "bdi" dats [txt x] + + +bdo :: AFSig s opq +bdo x y = (\_ -> PwElement "bdo" x y) + +bdo' :: Sig s opq +bdo' = PwElement "bdo" + +bdo_ :: AFSig_ s opq +bdo_ x = (\_ -> PwElement "bdo" dats x) + +bdo'_ :: Sig_ s opq +bdo'_ x = PwElement "bdo" dats x + +bdo__ :: AFSig__ s opq +bdo__ x = (\_ -> PwElement "bdo" dats [txt x]) + +bdo'__ :: Sig__ s opq +bdo'__ x = PwElement "bdo" dats [txt x] + + +big :: AFSig s opq +big x y = (\_ -> PwElement "big" x y) + +big' :: Sig s opq +big' = PwElement "big" + +big_ :: AFSig_ s opq +big_ x = (\_ -> PwElement "big" dats x) + +big'_ :: Sig_ s opq +big'_ x = PwElement "big" dats x + +big__ :: AFSig__ s opq +big__ x = (\_ -> PwElement "big" dats [txt x]) + +big'__ :: Sig__ s opq +big'__ x = PwElement "big" dats [txt x] + + +blockquote :: AFSig s opq +blockquote x y = (\_ -> PwElement "blockquote" x y) + +blockquote' :: Sig s opq +blockquote' = PwElement "blockquote" + +blockquote_ :: AFSig_ s opq +blockquote_ x = (\_ -> PwElement "blockquote" dats x) + +blockquote'_ :: Sig_ s opq +blockquote'_ x = PwElement "blockquote" dats x + +blockquote__ :: AFSig__ s opq +blockquote__ x = (\_ -> PwElement "blockquote" dats [txt x]) + +blockquote'__ :: Sig__ s opq +blockquote'__ x = PwElement "blockquote" dats [txt x] + + +body :: AFSig s opq +body x y = (\_ -> PwElement "body" x y) + +body' :: Sig s opq +body' = PwElement "body" + +body_ :: AFSig_ s opq +body_ x = (\_ -> PwElement "body" dats x) + +body'_ :: Sig_ s opq +body'_ x = PwElement "body" dats x + +body__ :: AFSig__ s opq +body__ x = (\_ -> PwElement "body" dats [txt x]) + +body'__ :: Sig__ s opq +body'__ x = PwElement "body" dats [txt x] + + +br :: (s -> PwNode s opq) +br = (\_ -> PwElement "br" dats []) + +button :: AFSig s opq +button x y = (\_ -> PwElement "button" x y) + +button' :: Sig s opq +button' = PwElement "button" + +button_ :: AFSig_ s opq +button_ x = (\_ -> PwElement "button" dats x) + +button'_ :: Sig_ s opq +button'_ x = PwElement "button" dats x + +button__ :: AFSig__ s opq +button__ x = (\_ -> PwElement "button" dats [txt x]) + +button'__ :: Sig__ s opq +button'__ x = PwElement "button" dats [txt x] + + +canvas :: AFSig s opq +canvas x y = (\_ -> PwElement "canvas" x y) + +canvas' :: Sig s opq +canvas' = PwElement "canvas" + +canvas_ :: AFSig_ s opq +canvas_ x = (\_ -> PwElement "canvas" dats x) + +canvas'_ :: Sig_ s opq +canvas'_ x = PwElement "canvas" dats x + +canvas__ :: AFSig__ s opq +canvas__ x = (\_ -> PwElement "canvas" dats [txt x]) + +canvas'__ :: Sig__ s opq +canvas'__ x = PwElement "canvas" dats [txt x] + + +caption :: AFSig s opq +caption x y = (\_ -> PwElement "caption" x y) + +caption' :: Sig s opq +caption' = PwElement "caption" + +caption_ :: AFSig_ s opq +caption_ x = (\_ -> PwElement "caption" dats x) + +caption'_ :: Sig_ s opq +caption'_ x = PwElement "caption" dats x + +caption__ :: AFSig__ s opq +caption__ x = (\_ -> PwElement "caption" dats [txt x]) + +caption'__ :: Sig__ s opq +caption'__ x = PwElement "caption" dats [txt x] + + +center :: AFSig s opq +center x y = (\_ -> PwElement "center" x y) + +center' :: Sig s opq +center' = PwElement "center" + +center_ :: AFSig_ s opq +center_ x = (\_ -> PwElement "center" dats x) + +center'_ :: Sig_ s opq +center'_ x = PwElement "center" dats x + +center__ :: AFSig__ s opq +center__ x = (\_ -> PwElement "center" dats [txt x]) + +center'__ :: Sig__ s opq +center'__ x = PwElement "center" dats [txt x] + + +cite :: AFSig s opq +cite x y = (\_ -> PwElement "cite" x y) + +cite' :: Sig s opq +cite' = PwElement "cite" + +cite_ :: AFSig_ s opq +cite_ x = (\_ -> PwElement "cite" dats x) + +cite'_ :: Sig_ s opq +cite'_ x = PwElement "cite" dats x + +cite__ :: AFSig__ s opq +cite__ x = (\_ -> PwElement "cite" dats [txt x]) + +cite'__ :: Sig__ s opq +cite'__ x = PwElement "cite" dats [txt x] + + +code :: AFSig s opq +code x y = (\_ -> PwElement "code" x y) + +code' :: Sig s opq +code' = PwElement "code" + +code_ :: AFSig_ s opq +code_ x = (\_ -> PwElement "code" dats x) + +code'_ :: Sig_ s opq +code'_ x = PwElement "code" dats x + +code__ :: AFSig__ s opq +code__ x = (\_ -> PwElement "code" dats [txt x]) + +code'__ :: Sig__ s opq +code'__ x = PwElement "code" dats [txt x] + + +col :: AFSig s opq +col x y = (\_ -> PwElement "col" x y) + +col' :: Sig s opq +col' = PwElement "col" + +col_ :: AFSig_ s opq +col_ x = (\_ -> PwElement "col" dats x) + +col'_ :: Sig_ s opq +col'_ x = PwElement "col" dats x + +col__ :: AFSig__ s opq +col__ x = (\_ -> PwElement "col" dats [txt x]) + +col'__ :: Sig__ s opq +col'__ x = PwElement "col" dats [txt x] + + +colgroup :: AFSig s opq +colgroup x y = (\_ -> PwElement "colgroup" x y) + +colgroup' :: Sig s opq +colgroup' = PwElement "colgroup" + +colgroup_ :: AFSig_ s opq +colgroup_ x = (\_ -> PwElement "colgroup" dats x) + +colgroup'_ :: Sig_ s opq +colgroup'_ x = PwElement "colgroup" dats x + +colgroup__ :: AFSig__ s opq +colgroup__ x = (\_ -> PwElement "colgroup" dats [txt x]) + +colgroup'__ :: Sig__ s opq +colgroup'__ x = PwElement "colgroup" dats [txt x] + + +_data :: AFSig s opq +_data x y = (\_ -> PwElement "_data" x y) + +_data' :: Sig s opq +_data' = PwElement "_data" + +_data_ :: AFSig_ s opq +_data_ x = (\_ -> PwElement "_data" dats x) + +_data'_ :: Sig_ s opq +_data'_ x = PwElement "_data" dats x + +_data__ :: AFSig__ s opq +_data__ x = (\_ -> PwElement "_data" dats [txt x]) + +_data'__ :: Sig__ s opq +_data'__ x = PwElement "_data" dats [txt x] + + +_datalist :: AFSig s opq +_datalist x y = (\_ -> PwElement "_datalist" x y) + +_datalist' :: Sig s opq +_datalist' = PwElement "_datalist" + +_datalist_ :: AFSig_ s opq +_datalist_ x = (\_ -> PwElement "_datalist" dats x) + +_datalist'_ :: Sig_ s opq +_datalist'_ x = PwElement "_datalist" dats x + +_datalist__ :: AFSig__ s opq +_datalist__ x = (\_ -> PwElement "_datalist" dats [txt x]) + +_datalist'__ :: Sig__ s opq +_datalist'__ x = PwElement "_datalist" dats [txt x] + + +dd :: AFSig s opq +dd x y = (\_ -> PwElement "dd" x y) + +dd' :: Sig s opq +dd' = PwElement "dd" + +dd_ :: AFSig_ s opq +dd_ x = (\_ -> PwElement "dd" dats x) + +dd'_ :: Sig_ s opq +dd'_ x = PwElement "dd" dats x + +dd__ :: AFSig__ s opq +dd__ x = (\_ -> PwElement "dd" dats [txt x]) + +dd'__ :: Sig__ s opq +dd'__ x = PwElement "dd" dats [txt x] + + +del :: AFSig s opq +del x y = (\_ -> PwElement "del" x y) + +del' :: Sig s opq +del' = PwElement "del" + +del_ :: AFSig_ s opq +del_ x = (\_ -> PwElement "del" dats x) + +del'_ :: Sig_ s opq +del'_ x = PwElement "del" dats x + +del__ :: AFSig__ s opq +del__ x = (\_ -> PwElement "del" dats [txt x]) + +del'__ :: Sig__ s opq +del'__ x = PwElement "del" dats [txt x] + + +details :: AFSig s opq +details x y = (\_ -> PwElement "details" x y) + +details' :: Sig s opq +details' = PwElement "details" + +details_ :: AFSig_ s opq +details_ x = (\_ -> PwElement "details" dats x) + +details'_ :: Sig_ s opq +details'_ x = PwElement "details" dats x + +details__ :: AFSig__ s opq +details__ x = (\_ -> PwElement "details" dats [txt x]) + +details'__ :: Sig__ s opq +details'__ x = PwElement "details" dats [txt x] + + +dfn :: AFSig s opq +dfn x y = (\_ -> PwElement "dfn" x y) + +dfn' :: Sig s opq +dfn' = PwElement "dfn" + +dfn_ :: AFSig_ s opq +dfn_ x = (\_ -> PwElement "dfn" dats x) + +dfn'_ :: Sig_ s opq +dfn'_ x = PwElement "dfn" dats x + +dfn__ :: AFSig__ s opq +dfn__ x = (\_ -> PwElement "dfn" dats [txt x]) + +dfn'__ :: Sig__ s opq +dfn'__ x = PwElement "dfn" dats [txt x] + + +dialog :: AFSig s opq +dialog x y = (\_ -> PwElement "dialog" x y) + +dialog' :: Sig s opq +dialog' = PwElement "dialog" + +dialog_ :: AFSig_ s opq +dialog_ x = (\_ -> PwElement "dialog" dats x) + +dialog'_ :: Sig_ s opq +dialog'_ x = PwElement "dialog" dats x + +dialog__ :: AFSig__ s opq +dialog__ x = (\_ -> PwElement "dialog" dats [txt x]) + +dialog'__ :: Sig__ s opq +dialog'__ x = PwElement "dialog" dats [txt x] + + +dir :: AFSig s opq +dir x y = (\_ -> PwElement "dir" x y) + +dir' :: Sig s opq +dir' = PwElement "dir" + +dir_ :: AFSig_ s opq +dir_ x = (\_ -> PwElement "dir" dats x) + +dir'_ :: Sig_ s opq +dir'_ x = PwElement "dir" dats x + +dir__ :: AFSig__ s opq +dir__ x = (\_ -> PwElement "dir" dats [txt x]) + +dir'__ :: Sig__ s opq +dir'__ x = PwElement "dir" dats [txt x] + + +div :: AFSig s opq +div x y = (\_ -> PwElement "div" x y) + +div' :: Sig s opq +div' = PwElement "div" + +div_ :: AFSig_ s opq +div_ x = (\_ -> PwElement "div" dats x) + +div'_ :: Sig_ s opq +div'_ x = PwElement "div" dats x + +div__ :: AFSig__ s opq +div__ x = (\_ -> PwElement "div" dats [txt x]) + +div'__ :: Sig__ s opq +div'__ x = PwElement "div" dats [txt x] + + +dl :: AFSig s opq +dl x y = (\_ -> PwElement "dl" x y) + +dl' :: Sig s opq +dl' = PwElement "dl" + +dl_ :: AFSig_ s opq +dl_ x = (\_ -> PwElement "dl" dats x) + +dl'_ :: Sig_ s opq +dl'_ x = PwElement "dl" dats x + +dl__ :: AFSig__ s opq +dl__ x = (\_ -> PwElement "dl" dats [txt x]) + +dl'__ :: Sig__ s opq +dl'__ x = PwElement "dl" dats [txt x] + + +dt :: AFSig s opq +dt x y = (\_ -> PwElement "dt" x y) + +dt' :: Sig s opq +dt' = PwElement "dt" + +dt_ :: AFSig_ s opq +dt_ x = (\_ -> PwElement "dt" dats x) + +dt'_ :: Sig_ s opq +dt'_ x = PwElement "dt" dats x + +dt__ :: AFSig__ s opq +dt__ x = (\_ -> PwElement "dt" dats [txt x]) + +dt'__ :: Sig__ s opq +dt'__ x = PwElement "dt" dats [txt x] + + +em :: AFSig s opq +em x y = (\_ -> PwElement "em" x y) + +em' :: Sig s opq +em' = PwElement "em" + +em_ :: AFSig_ s opq +em_ x = (\_ -> PwElement "em" dats x) + +em'_ :: Sig_ s opq +em'_ x = PwElement "em" dats x + +em__ :: AFSig__ s opq +em__ x = (\_ -> PwElement "em" dats [txt x]) + +em'__ :: Sig__ s opq +em'__ x = PwElement "em" dats [txt x] + + +embed :: AFSig s opq +embed x y = (\_ -> PwElement "embed" x y) + +embed' :: Sig s opq +embed' = PwElement "embed" + +embed_ :: AFSig_ s opq +embed_ x = (\_ -> PwElement "embed" dats x) + +embed'_ :: Sig_ s opq +embed'_ x = PwElement "embed" dats x + +embed__ :: AFSig__ s opq +embed__ x = (\_ -> PwElement "embed" dats [txt x]) + +embed'__ :: Sig__ s opq +embed'__ x = PwElement "embed" dats [txt x] + + +fieldset :: AFSig s opq +fieldset x y = (\_ -> PwElement "fieldset" x y) + +fieldset' :: Sig s opq +fieldset' = PwElement "fieldset" + +fieldset_ :: AFSig_ s opq +fieldset_ x = (\_ -> PwElement "fieldset" dats x) + +fieldset'_ :: Sig_ s opq +fieldset'_ x = PwElement "fieldset" dats x + +fieldset__ :: AFSig__ s opq +fieldset__ x = (\_ -> PwElement "fieldset" dats [txt x]) + +fieldset'__ :: Sig__ s opq +fieldset'__ x = PwElement "fieldset" dats [txt x] + + +figcaption :: AFSig s opq +figcaption x y = (\_ -> PwElement "figcaption" x y) + +figcaption' :: Sig s opq +figcaption' = PwElement "figcaption" + +figcaption_ :: AFSig_ s opq +figcaption_ x = (\_ -> PwElement "figcaption" dats x) + +figcaption'_ :: Sig_ s opq +figcaption'_ x = PwElement "figcaption" dats x + +figcaption__ :: AFSig__ s opq +figcaption__ x = (\_ -> PwElement "figcaption" dats [txt x]) + +figcaption'__ :: Sig__ s opq +figcaption'__ x = PwElement "figcaption" dats [txt x] + + +figure :: AFSig s opq +figure x y = (\_ -> PwElement "figure" x y) + +figure' :: Sig s opq +figure' = PwElement "figure" + +figure_ :: AFSig_ s opq +figure_ x = (\_ -> PwElement "figure" dats x) + +figure'_ :: Sig_ s opq +figure'_ x = PwElement "figure" dats x + +figure__ :: AFSig__ s opq +figure__ x = (\_ -> PwElement "figure" dats [txt x]) + +figure'__ :: Sig__ s opq +figure'__ x = PwElement "figure" dats [txt x] + + +font :: AFSig s opq +font x y = (\_ -> PwElement "font" x y) + +font' :: Sig s opq +font' = PwElement "font" + +font_ :: AFSig_ s opq +font_ x = (\_ -> PwElement "font" dats x) + +font'_ :: Sig_ s opq +font'_ x = PwElement "font" dats x + +font__ :: AFSig__ s opq +font__ x = (\_ -> PwElement "font" dats [txt x]) + +font'__ :: Sig__ s opq +font'__ x = PwElement "font" dats [txt x] + + +footer :: AFSig s opq +footer x y = (\_ -> PwElement "footer" x y) + +footer' :: Sig s opq +footer' = PwElement "footer" + +footer_ :: AFSig_ s opq +footer_ x = (\_ -> PwElement "footer" dats x) + +footer'_ :: Sig_ s opq +footer'_ x = PwElement "footer" dats x + +footer__ :: AFSig__ s opq +footer__ x = (\_ -> PwElement "footer" dats [txt x]) + +footer'__ :: Sig__ s opq +footer'__ x = PwElement "footer" dats [txt x] + + +form :: AFSig s opq +form x y = (\_ -> PwElement "form" x y) + +form' :: Sig s opq +form' = PwElement "form" + +form_ :: AFSig_ s opq +form_ x = (\_ -> PwElement "form" dats x) + +form'_ :: Sig_ s opq +form'_ x = PwElement "form" dats x + +form__ :: AFSig__ s opq +form__ x = (\_ -> PwElement "form" dats [txt x]) + +form'__ :: Sig__ s opq +form'__ x = PwElement "form" dats [txt x] + + +frame :: AFSig s opq +frame x y = (\_ -> PwElement "frame" x y) + +frame' :: Sig s opq +frame' = PwElement "frame" + +frame_ :: AFSig_ s opq +frame_ x = (\_ -> PwElement "frame" dats x) + +frame'_ :: Sig_ s opq +frame'_ x = PwElement "frame" dats x + +frame__ :: AFSig__ s opq +frame__ x = (\_ -> PwElement "frame" dats [txt x]) + +frame'__ :: Sig__ s opq +frame'__ x = PwElement "frame" dats [txt x] + + +frameset :: AFSig s opq +frameset x y = (\_ -> PwElement "frameset" x y) + +frameset' :: Sig s opq +frameset' = PwElement "frameset" + +frameset_ :: AFSig_ s opq +frameset_ x = (\_ -> PwElement "frameset" dats x) + +frameset'_ :: Sig_ s opq +frameset'_ x = PwElement "frameset" dats x + +frameset__ :: AFSig__ s opq +frameset__ x = (\_ -> PwElement "frameset" dats [txt x]) + +frameset'__ :: Sig__ s opq +frameset'__ x = PwElement "frameset" dats [txt x] + +head :: AFSig s opq +head x y = (\_ -> PwElement "head" x y) + +head' :: Sig s opq +head' = PwElement "head" + +head_ :: AFSig_ s opq +head_ x = (\_ -> PwElement "head" dats x) + +head'_ :: Sig_ s opq +head'_ x = PwElement "head" dats x + +head__ :: AFSig__ s opq +head__ x = (\_ -> PwElement "head" dats [txt x]) + +head'__ :: Sig__ s opq +head'__ x = PwElement "head" dats [txt x] + + +header :: AFSig s opq +header x y = (\_ -> PwElement "header" x y) + +header' :: Sig s opq +header' = PwElement "header" + +header_ :: AFSig_ s opq +header_ x = (\_ -> PwElement "header" dats x) + +header'_ :: Sig_ s opq +header'_ x = PwElement "header" dats x + +header__ :: AFSig__ s opq +header__ x = (\_ -> PwElement "header" dats [txt x]) + +header'__ :: Sig__ s opq +header'__ x = PwElement "header" dats [txt x] + + +hr :: (s -> PwNode s opq) +hr = (\_ -> PwElement "br" dats []) + +html :: AFSig s opq +html x y = (\_ -> PwElement "html" x y) + +html' :: Sig s opq +html' = PwElement "html" + +html_ :: AFSig_ s opq +html_ x = (\_ -> PwElement "html" dats x) + +html'_ :: Sig_ s opq +html'_ x = PwElement "html" dats x + +html__ :: AFSig__ s opq +html__ x = (\_ -> PwElement "html" dats [txt x]) + +html'__ :: Sig__ s opq +html'__ x = PwElement "html" dats [txt x] + + +i :: AFSig s opq +i x y = (\_ -> PwElement "i" x y) + +i' :: Sig s opq +i' = PwElement "i" + +i_ :: AFSig_ s opq +i_ x = (\_ -> PwElement "i" dats x) + +i'_ :: Sig_ s opq +i'_ x = PwElement "i" dats x + +i__ :: AFSig__ s opq +i__ x = (\_ -> PwElement "i" dats [txt x]) + +i'__ :: Sig__ s opq +i'__ x = PwElement "i" dats [txt x] + + +iframe :: AFSig s opq +iframe x y = (\_ -> PwElement "iframe" x y) + +iframe' :: Sig s opq +iframe' = PwElement "iframe" + +iframe_ :: AFSig_ s opq +iframe_ x = (\_ -> PwElement "iframe" dats x) + +iframe'_ :: Sig_ s opq +iframe'_ x = PwElement "iframe" dats x + +iframe__ :: AFSig__ s opq +iframe__ x = (\_ -> PwElement "iframe" dats [txt x]) + +iframe'__ :: Sig__ s opq +iframe'__ x = PwElement "iframe" dats [txt x] + + +img :: [(String, (s -> PwAttribute s opq))] -> (s -> PwNode s opq) +img x = (\_ -> PwElement "img" x []) + +img' :: [(String, (s -> PwAttribute s opq))] -> PwNode s opq +img' x = PwElement "img" x [] + +img_ :: (s -> PwNode s opq) +img_ = (\_ -> PwElement "img" dats []) + +img'_ :: PwNode s opq +img'_ = PwElement "img" dats [] + +input :: AFSig s opq +input x y = (\_ -> PwElement "input" x y) + +input' :: Sig s opq +input' = PwElement "input" + +input_ :: AFSig_ s opq +input_ x = (\_ -> PwElement "input" dats x) + +input'_ :: Sig_ s opq +input'_ x = PwElement "input" dats x + +input__ :: AFSig__ s opq +input__ x = (\_ -> PwElement "input" dats [txt x]) + +input'__ :: Sig__ s opq +input'__ x = PwElement "input" dats [txt x] + + +ins :: AFSig s opq +ins x y = (\_ -> PwElement "ins" x y) + +ins' :: Sig s opq +ins' = PwElement "ins" + +ins_ :: AFSig_ s opq +ins_ x = (\_ -> PwElement "ins" dats x) + +ins'_ :: Sig_ s opq +ins'_ x = PwElement "ins" dats x + +ins__ :: AFSig__ s opq +ins__ x = (\_ -> PwElement "ins" dats [txt x]) + +ins'__ :: Sig__ s opq +ins'__ x = PwElement "ins" dats [txt x] + + +kbd :: AFSig s opq +kbd x y = (\_ -> PwElement "kbd" x y) + +kbd' :: Sig s opq +kbd' = PwElement "kbd" + +kbd_ :: AFSig_ s opq +kbd_ x = (\_ -> PwElement "kbd" dats x) + +kbd'_ :: Sig_ s opq +kbd'_ x = PwElement "kbd" dats x + +kbd__ :: AFSig__ s opq +kbd__ x = (\_ -> PwElement "kbd" dats [txt x]) + +kbd'__ :: Sig__ s opq +kbd'__ x = PwElement "kbd" dats [txt x] + + +label :: AFSig s opq +label x y = (\_ -> PwElement "label" x y) + +label' :: Sig s opq +label' = PwElement "label" + +label_ :: AFSig_ s opq +label_ x = (\_ -> PwElement "label" dats x) + +label'_ :: Sig_ s opq +label'_ x = PwElement "label" dats x + +label__ :: AFSig__ s opq +label__ x = (\_ -> PwElement "label" dats [txt x]) + +label'__ :: Sig__ s opq +label'__ x = PwElement "label" dats [txt x] + + +legend :: AFSig s opq +legend x y = (\_ -> PwElement "legend" x y) + +legend' :: Sig s opq +legend' = PwElement "legend" + +legend_ :: AFSig_ s opq +legend_ x = (\_ -> PwElement "legend" dats x) + +legend'_ :: Sig_ s opq +legend'_ x = PwElement "legend" dats x + +legend__ :: AFSig__ s opq +legend__ x = (\_ -> PwElement "legend" dats [txt x]) + +legend'__ :: Sig__ s opq +legend'__ x = PwElement "legend" dats [txt x] + + +li :: AFSig s opq +li x y = (\_ -> PwElement "li" x y) + +li' :: Sig s opq +li' = PwElement "li" + +li_ :: AFSig_ s opq +li_ x = (\_ -> PwElement "li" dats x) + +li'_ :: Sig_ s opq +li'_ x = PwElement "li" dats x + +li__ :: AFSig__ s opq +li__ x = (\_ -> PwElement "li" dats [txt x]) + +li'__ :: Sig__ s opq +li'__ x = PwElement "li" dats [txt x] + + +link :: AFSig s opq +link x y = (\_ -> PwElement "link" x y) + +link' :: Sig s opq +link' = PwElement "link" + +link_ :: AFSig_ s opq +link_ x = (\_ -> PwElement "link" dats x) + +link'_ :: Sig_ s opq +link'_ x = PwElement "link" dats x + +link__ :: AFSig__ s opq +link__ x = (\_ -> PwElement "link" dats [txt x]) + +link'__ :: Sig__ s opq +link'__ x = PwElement "link" dats [txt x] + + +main :: AFSig s opq +main x y = (\_ -> PwElement "main" x y) + +main' :: Sig s opq +main' = PwElement "main" + +main_ :: AFSig_ s opq +main_ x = (\_ -> PwElement "main" dats x) + +main'_ :: Sig_ s opq +main'_ x = PwElement "main" dats x + +main__ :: AFSig__ s opq +main__ x = (\_ -> PwElement "main" dats [txt x]) + +main'__ :: Sig__ s opq +main'__ x = PwElement "main" dats [txt x] + + +map :: AFSig s opq +map x y = (\_ -> PwElement "map" x y) + +map' :: Sig s opq +map' = PwElement "map" + +map_ :: AFSig_ s opq +map_ x = (\_ -> PwElement "map" dats x) + +map'_ :: Sig_ s opq +map'_ x = PwElement "map" dats x + +map__ :: AFSig__ s opq +map__ x = (\_ -> PwElement "map" dats [txt x]) + +map'__ :: Sig__ s opq +map'__ x = PwElement "map" dats [txt x] + + +mark :: AFSig s opq +mark x y = (\_ -> PwElement "mark" x y) + +mark' :: Sig s opq +mark' = PwElement "mark" + +mark_ :: AFSig_ s opq +mark_ x = (\_ -> PwElement "mark" dats x) + +mark'_ :: Sig_ s opq +mark'_ x = PwElement "mark" dats x + +mark__ :: AFSig__ s opq +mark__ x = (\_ -> PwElement "mark" dats [txt x]) + +mark'__ :: Sig__ s opq +mark'__ x = PwElement "mark" dats [txt x] + + +meta :: AFSig s opq +meta x y = (\_ -> PwElement "meta" x y) + +meta' :: Sig s opq +meta' = PwElement "meta" + +meta_ :: AFSig_ s opq +meta_ x = (\_ -> PwElement "meta" dats x) + +meta'_ :: Sig_ s opq +meta'_ x = PwElement "meta" dats x + +meta__ :: AFSig__ s opq +meta__ x = (\_ -> PwElement "meta" dats [txt x]) + +meta'__ :: Sig__ s opq +meta'__ x = PwElement "meta" dats [txt x] + + +meter :: AFSig s opq +meter x y = (\_ -> PwElement "meter" x y) + +meter' :: Sig s opq +meter' = PwElement "meter" + +meter_ :: AFSig_ s opq +meter_ x = (\_ -> PwElement "meter" dats x) + +meter'_ :: Sig_ s opq +meter'_ x = PwElement "meter" dats x + +meter__ :: AFSig__ s opq +meter__ x = (\_ -> PwElement "meter" dats [txt x]) + +meter'__ :: Sig__ s opq +meter'__ x = PwElement "meter" dats [txt x] + + +nav :: AFSig s opq +nav x y = (\_ -> PwElement "nav" x y) + +nav' :: Sig s opq +nav' = PwElement "nav" + +nav_ :: AFSig_ s opq +nav_ x = (\_ -> PwElement "nav" dats x) + +nav'_ :: Sig_ s opq +nav'_ x = PwElement "nav" dats x + +nav__ :: AFSig__ s opq +nav__ x = (\_ -> PwElement "nav" dats [txt x]) + +nav'__ :: Sig__ s opq +nav'__ x = PwElement "nav" dats [txt x] + + +noframes :: AFSig s opq +noframes x y = (\_ -> PwElement "noframes" x y) + +noframes' :: Sig s opq +noframes' = PwElement "noframes" + +noframes_ :: AFSig_ s opq +noframes_ x = (\_ -> PwElement "noframes" dats x) + +noframes'_ :: Sig_ s opq +noframes'_ x = PwElement "noframes" dats x + +noframes__ :: AFSig__ s opq +noframes__ x = (\_ -> PwElement "noframes" dats [txt x]) + +noframes'__ :: Sig__ s opq +noframes'__ x = PwElement "noframes" dats [txt x] + + +noscript :: AFSig s opq +noscript x y = (\_ -> PwElement "noscript" x y) + +noscript' :: Sig s opq +noscript' = PwElement "noscript" + +noscript_ :: AFSig_ s opq +noscript_ x = (\_ -> PwElement "noscript" dats x) + +noscript'_ :: Sig_ s opq +noscript'_ x = PwElement "noscript" dats x + +noscript__ :: AFSig__ s opq +noscript__ x = (\_ -> PwElement "noscript" dats [txt x]) + +noscript'__ :: Sig__ s opq +noscript'__ x = PwElement "noscript" dats [txt x] + + +object :: AFSig s opq +object x y = (\_ -> PwElement "object" x y) + +object' :: Sig s opq +object' = PwElement "object" + +object_ :: AFSig_ s opq +object_ x = (\_ -> PwElement "object" dats x) + +object'_ :: Sig_ s opq +object'_ x = PwElement "object" dats x + +object__ :: AFSig__ s opq +object__ x = (\_ -> PwElement "object" dats [txt x]) + +object'__ :: Sig__ s opq +object'__ x = PwElement "object" dats [txt x] + + +ol :: AFSig s opq +ol x y = (\_ -> PwElement "ol" x y) + +ol' :: Sig s opq +ol' = PwElement "ol" + +ol_ :: AFSig_ s opq +ol_ x = (\_ -> PwElement "ol" dats x) + +ol'_ :: Sig_ s opq +ol'_ x = PwElement "ol" dats x + +ol__ :: AFSig__ s opq +ol__ x = (\_ -> PwElement "ol" dats [txt x]) + +ol'__ :: Sig__ s opq +ol'__ x = PwElement "ol" dats [txt x] + + +optgroup :: AFSig s opq +optgroup x y = (\_ -> PwElement "optgroup" x y) + +optgroup' :: Sig s opq +optgroup' = PwElement "optgroup" + +optgroup_ :: AFSig_ s opq +optgroup_ x = (\_ -> PwElement "optgroup" dats x) + +optgroup'_ :: Sig_ s opq +optgroup'_ x = PwElement "optgroup" dats x + +optgroup__ :: AFSig__ s opq +optgroup__ x = (\_ -> PwElement "optgroup" dats [txt x]) + +optgroup'__ :: Sig__ s opq +optgroup'__ x = PwElement "optgroup" dats [txt x] + + +option :: AFSig s opq +option x y = (\_ -> PwElement "option" x y) + +option' :: Sig s opq +option' = PwElement "option" + +option_ :: AFSig_ s opq +option_ x = (\_ -> PwElement "option" dats x) + +option'_ :: Sig_ s opq +option'_ x = PwElement "option" dats x + +option__ :: AFSig__ s opq +option__ x = (\_ -> PwElement "option" dats [txt x]) + +option'__ :: Sig__ s opq +option'__ x = PwElement "option" dats [txt x] + + +output :: AFSig s opq +output x y = (\_ -> PwElement "output" x y) + +output' :: Sig s opq +output' = PwElement "output" + +output_ :: AFSig_ s opq +output_ x = (\_ -> PwElement "output" dats x) + +output'_ :: Sig_ s opq +output'_ x = PwElement "output" dats x + +output__ :: AFSig__ s opq +output__ x = (\_ -> PwElement "output" dats [txt x]) + +output'__ :: Sig__ s opq +output'__ x = PwElement "output" dats [txt x] + + +p :: AFSig s opq +p x y = (\_ -> PwElement "p" x y) + +p' :: Sig s opq +p' = PwElement "p" + +p_ :: AFSig_ s opq +p_ x = (\_ -> PwElement "p" dats x) + +p'_ :: Sig_ s opq +p'_ x = PwElement "p" dats x + +p__ :: AFSig__ s opq +p__ x = (\_ -> PwElement "p" dats [txt x]) + +p'__ :: Sig__ s opq +p'__ x = PwElement "p" dats [txt x] + + +param :: AFSig s opq +param x y = (\_ -> PwElement "param" x y) + +param' :: Sig s opq +param' = PwElement "param" + +param_ :: AFSig_ s opq +param_ x = (\_ -> PwElement "param" dats x) + +param'_ :: Sig_ s opq +param'_ x = PwElement "param" dats x + +param__ :: AFSig__ s opq +param__ x = (\_ -> PwElement "param" dats [txt x]) + +param'__ :: Sig__ s opq +param'__ x = PwElement "param" dats [txt x] + + +picture :: AFSig s opq +picture x y = (\_ -> PwElement "picture" x y) + +picture' :: Sig s opq +picture' = PwElement "picture" + +picture_ :: AFSig_ s opq +picture_ x = (\_ -> PwElement "picture" dats x) + +picture'_ :: Sig_ s opq +picture'_ x = PwElement "picture" dats x + +picture__ :: AFSig__ s opq +picture__ x = (\_ -> PwElement "picture" dats [txt x]) + +picture'__ :: Sig__ s opq +picture'__ x = PwElement "picture" dats [txt x] + + +pre :: AFSig s opq +pre x y = (\_ -> PwElement "pre" x y) + +pre' :: Sig s opq +pre' = PwElement "pre" + +pre_ :: AFSig_ s opq +pre_ x = (\_ -> PwElement "pre" dats x) + +pre'_ :: Sig_ s opq +pre'_ x = PwElement "pre" dats x + +pre__ :: AFSig__ s opq +pre__ x = (\_ -> PwElement "pre" dats [txt x]) + +pre'__ :: Sig__ s opq +pre'__ x = PwElement "pre" dats [txt x] + + +progress :: AFSig s opq +progress x y = (\_ -> PwElement "progress" x y) + +progress' :: Sig s opq +progress' = PwElement "progress" + +progress_ :: AFSig_ s opq +progress_ x = (\_ -> PwElement "progress" dats x) + +progress'_ :: Sig_ s opq +progress'_ x = PwElement "progress" dats x + +progress__ :: AFSig__ s opq +progress__ x = (\_ -> PwElement "progress" dats [txt x]) + +progress'__ :: Sig__ s opq +progress'__ x = PwElement "progress" dats [txt x] + + +q :: AFSig s opq +q x y = (\_ -> PwElement "q" x y) + +q' :: Sig s opq +q' = PwElement "q" + +q_ :: AFSig_ s opq +q_ x = (\_ -> PwElement "q" dats x) + +q'_ :: Sig_ s opq +q'_ x = PwElement "q" dats x + +q__ :: AFSig__ s opq +q__ x = (\_ -> PwElement "q" dats [txt x]) + +q'__ :: Sig__ s opq +q'__ x = PwElement "q" dats [txt x] + + +rp :: AFSig s opq +rp x y = (\_ -> PwElement "rp" x y) + +rp' :: Sig s opq +rp' = PwElement "rp" + +rp_ :: AFSig_ s opq +rp_ x = (\_ -> PwElement "rp" dats x) + +rp'_ :: Sig_ s opq +rp'_ x = PwElement "rp" dats x + +rp__ :: AFSig__ s opq +rp__ x = (\_ -> PwElement "rp" dats [txt x]) + +rp'__ :: Sig__ s opq +rp'__ x = PwElement "rp" dats [txt x] + + +rt :: AFSig s opq +rt x y = (\_ -> PwElement "rt" x y) + +rt' :: Sig s opq +rt' = PwElement "rt" + +rt_ :: AFSig_ s opq +rt_ x = (\_ -> PwElement "rt" dats x) + +rt'_ :: Sig_ s opq +rt'_ x = PwElement "rt" dats x + +rt__ :: AFSig__ s opq +rt__ x = (\_ -> PwElement "rt" dats [txt x]) + +rt'__ :: Sig__ s opq +rt'__ x = PwElement "rt" dats [txt x] + + +ruby :: AFSig s opq +ruby x y = (\_ -> PwElement "ruby" x y) + +ruby' :: Sig s opq +ruby' = PwElement "ruby" + +ruby_ :: AFSig_ s opq +ruby_ x = (\_ -> PwElement "ruby" dats x) + +ruby'_ :: Sig_ s opq +ruby'_ x = PwElement "ruby" dats x + +ruby__ :: AFSig__ s opq +ruby__ x = (\_ -> PwElement "ruby" dats [txt x]) + +ruby'__ :: Sig__ s opq +ruby'__ x = PwElement "ruby" dats [txt x] + + +s :: AFSig s opq +s x y = (\_ -> PwElement "s" x y) + +s' :: Sig s opq +s' = PwElement "s" + +s_ :: AFSig_ s opq +s_ x = (\_ -> PwElement "s" dats x) + +s'_ :: Sig_ s opq +s'_ x = PwElement "s" dats x + +s__ :: AFSig__ s opq +s__ x = (\_ -> PwElement "s" dats [txt x]) + +s'__ :: Sig__ s opq +s'__ x = PwElement "s" dats [txt x] + + +samp :: AFSig s opq +samp x y = (\_ -> PwElement "samp" x y) + +samp' :: Sig s opq +samp' = PwElement "samp" + +samp_ :: AFSig_ s opq +samp_ x = (\_ -> PwElement "samp" dats x) + +samp'_ :: Sig_ s opq +samp'_ x = PwElement "samp" dats x + +samp__ :: AFSig__ s opq +samp__ x = (\_ -> PwElement "samp" dats [txt x]) + +samp'__ :: Sig__ s opq +samp'__ x = PwElement "samp" dats [txt x] + + +script :: AFSig s opq +script x y = (\_ -> PwElement "script" x y) + +script' :: Sig s opq +script' = PwElement "script" + +script_ :: AFSig_ s opq +script_ x = (\_ -> PwElement "script" dats x) + +script'_ :: Sig_ s opq +script'_ x = PwElement "script" dats x + +script__ :: AFSig__ s opq +script__ x = (\_ -> PwElement "script" dats [txt x]) + +script'__ :: Sig__ s opq +script'__ x = PwElement "script" dats [txt x] + + +section :: AFSig s opq +section x y = (\_ -> PwElement "section" x y) + +section' :: Sig s opq +section' = PwElement "section" + +section_ :: AFSig_ s opq +section_ x = (\_ -> PwElement "section" dats x) + +section'_ :: Sig_ s opq +section'_ x = PwElement "section" dats x + +section__ :: AFSig__ s opq +section__ x = (\_ -> PwElement "section" dats [txt x]) + +section'__ :: Sig__ s opq +section'__ x = PwElement "section" dats [txt x] + + +select :: AFSig s opq +select x y = (\_ -> PwElement "select" x y) + +select' :: Sig s opq +select' = PwElement "select" + +select_ :: AFSig_ s opq +select_ x = (\_ -> PwElement "select" dats x) + +select'_ :: Sig_ s opq +select'_ x = PwElement "select" dats x + +select__ :: AFSig__ s opq +select__ x = (\_ -> PwElement "select" dats [txt x]) + +select'__ :: Sig__ s opq +select'__ x = PwElement "select" dats [txt x] + + +small :: AFSig s opq +small x y = (\_ -> PwElement "small" x y) + +small' :: Sig s opq +small' = PwElement "small" + +small_ :: AFSig_ s opq +small_ x = (\_ -> PwElement "small" dats x) + +small'_ :: Sig_ s opq +small'_ x = PwElement "small" dats x + +small__ :: AFSig__ s opq +small__ x = (\_ -> PwElement "small" dats [txt x]) + +small'__ :: Sig__ s opq +small'__ x = PwElement "small" dats [txt x] + + +source :: AFSig s opq +source x y = (\_ -> PwElement "source" x y) + +source' :: Sig s opq +source' = PwElement "source" + +source_ :: AFSig_ s opq +source_ x = (\_ -> PwElement "source" dats x) + +source'_ :: Sig_ s opq +source'_ x = PwElement "source" dats x + +source__ :: AFSig__ s opq +source__ x = (\_ -> PwElement "source" dats [txt x]) + +source'__ :: Sig__ s opq +source'__ x = PwElement "source" dats [txt x] + + +span :: AFSig s opq +span x y = (\_ -> PwElement "span" x y) + +span' :: Sig s opq +span' = PwElement "span" + +span_ :: AFSig_ s opq +span_ x = (\_ -> PwElement "span" dats x) + +span'_ :: Sig_ s opq +span'_ x = PwElement "span" dats x + +span__ :: AFSig__ s opq +span__ x = (\_ -> PwElement "span" dats [txt x]) + +span'__ :: Sig__ s opq +span'__ x = PwElement "span" dats [txt x] + + +strike :: AFSig s opq +strike x y = (\_ -> PwElement "strike" x y) + +strike' :: Sig s opq +strike' = PwElement "strike" + +strike_ :: AFSig_ s opq +strike_ x = (\_ -> PwElement "strike" dats x) + +strike'_ :: Sig_ s opq +strike'_ x = PwElement "strike" dats x + +strike__ :: AFSig__ s opq +strike__ x = (\_ -> PwElement "strike" dats [txt x]) + +strike'__ :: Sig__ s opq +strike'__ x = PwElement "strike" dats [txt x] + + +strong :: AFSig s opq +strong x y = (\_ -> PwElement "strong" x y) + +strong' :: Sig s opq +strong' = PwElement "strong" + +strong_ :: AFSig_ s opq +strong_ x = (\_ -> PwElement "strong" dats x) + +strong'_ :: Sig_ s opq +strong'_ x = PwElement "strong" dats x + +strong__ :: AFSig__ s opq +strong__ x = (\_ -> PwElement "strong" dats [txt x]) + +strong'__ :: Sig__ s opq +strong'__ x = PwElement "strong" dats [txt x] + + +style :: AFSig s opq +style x y = (\_ -> PwElement "style" x y) + +style' :: Sig s opq +style' = PwElement "style" + +style_ :: AFSig_ s opq +style_ x = (\_ -> PwElement "style" dats x) + +style'_ :: Sig_ s opq +style'_ x = PwElement "style" dats x + +style__ :: AFSig__ s opq +style__ x = (\_ -> PwElement "style" dats [txt x]) + +style'__ :: Sig__ s opq +style'__ x = PwElement "style" dats [txt x] + + +sub :: AFSig s opq +sub x y = (\_ -> PwElement "sub" x y) + +sub' :: Sig s opq +sub' = PwElement "sub" + +sub_ :: AFSig_ s opq +sub_ x = (\_ -> PwElement "sub" dats x) + +sub'_ :: Sig_ s opq +sub'_ x = PwElement "sub" dats x + +sub__ :: AFSig__ s opq +sub__ x = (\_ -> PwElement "sub" dats [txt x]) + +sub'__ :: Sig__ s opq +sub'__ x = PwElement "sub" dats [txt x] + + +summary :: AFSig s opq +summary x y = (\_ -> PwElement "summary" x y) + +summary' :: Sig s opq +summary' = PwElement "summary" + +summary_ :: AFSig_ s opq +summary_ x = (\_ -> PwElement "summary" dats x) + +summary'_ :: Sig_ s opq +summary'_ x = PwElement "summary" dats x + +summary__ :: AFSig__ s opq +summary__ x = (\_ -> PwElement "summary" dats [txt x]) + +summary'__ :: Sig__ s opq +summary'__ x = PwElement "summary" dats [txt x] + + +sup :: AFSig s opq +sup x y = (\_ -> PwElement "sup" x y) + +sup' :: Sig s opq +sup' = PwElement "sup" + +sup_ :: AFSig_ s opq +sup_ x = (\_ -> PwElement "sup" dats x) + +sup'_ :: Sig_ s opq +sup'_ x = PwElement "sup" dats x + +sup__ :: AFSig__ s opq +sup__ x = (\_ -> PwElement "sup" dats [txt x]) + +sup'__ :: Sig__ s opq +sup'__ x = PwElement "sup" dats [txt x] + + +svg :: AFSig s opq +svg x y = (\_ -> PwElement "svg" x y) + +svg' :: Sig s opq +svg' = PwElement "svg" + +svg_ :: AFSig_ s opq +svg_ x = (\_ -> PwElement "svg" dats x) + +svg'_ :: Sig_ s opq +svg'_ x = PwElement "svg" dats x + +svg__ :: AFSig__ s opq +svg__ x = (\_ -> PwElement "svg" dats [txt x]) + +svg'__ :: Sig__ s opq +svg'__ x = PwElement "svg" dats [txt x] + + +table :: AFSig s opq +table x y = (\_ -> PwElement "table" x y) + +table' :: Sig s opq +table' = PwElement "table" + +table_ :: AFSig_ s opq +table_ x = (\_ -> PwElement "table" dats x) + +table'_ :: Sig_ s opq +table'_ x = PwElement "table" dats x + +table__ :: AFSig__ s opq +table__ x = (\_ -> PwElement "table" dats [txt x]) + +table'__ :: Sig__ s opq +table'__ x = PwElement "table" dats [txt x] + + +tbody :: AFSig s opq +tbody x y = (\_ -> PwElement "tbody" x y) + +tbody' :: Sig s opq +tbody' = PwElement "tbody" + +tbody_ :: AFSig_ s opq +tbody_ x = (\_ -> PwElement "tbody" dats x) + +tbody'_ :: Sig_ s opq +tbody'_ x = PwElement "tbody" dats x + +tbody__ :: AFSig__ s opq +tbody__ x = (\_ -> PwElement "tbody" dats [txt x]) + +tbody'__ :: Sig__ s opq +tbody'__ x = PwElement "tbody" dats [txt x] + + +td :: AFSig s opq +td x y = (\_ -> PwElement "td" x y) + +td' :: Sig s opq +td' = PwElement "td" + +td_ :: AFSig_ s opq +td_ x = (\_ -> PwElement "td" dats x) + +td'_ :: Sig_ s opq +td'_ x = PwElement "td" dats x + +td__ :: AFSig__ s opq +td__ x = (\_ -> PwElement "td" dats [txt x]) + +td'__ :: Sig__ s opq +td'__ x = PwElement "td" dats [txt x] + + +template :: AFSig s opq +template x y = (\_ -> PwElement "template" x y) + +template' :: Sig s opq +template' = PwElement "template" + +template_ :: AFSig_ s opq +template_ x = (\_ -> PwElement "template" dats x) + +template'_ :: Sig_ s opq +template'_ x = PwElement "template" dats x + +template__ :: AFSig__ s opq +template__ x = (\_ -> PwElement "template" dats [txt x]) + +template'__ :: Sig__ s opq +template'__ x = PwElement "template" dats [txt x] + + +textarea :: AFSig s opq +textarea x y = (\_ -> PwElement "textarea" x y) + +textarea' :: Sig s opq +textarea' = PwElement "textarea" + +textarea_ :: AFSig_ s opq +textarea_ x = (\_ -> PwElement "textarea" dats x) + +textarea'_ :: Sig_ s opq +textarea'_ x = PwElement "textarea" dats x + +textarea__ :: AFSig__ s opq +textarea__ x = (\_ -> PwElement "textarea" dats [txt x]) + +textarea'__ :: Sig__ s opq +textarea'__ x = PwElement "textarea" dats [txt x] + + +tfoot :: AFSig s opq +tfoot x y = (\_ -> PwElement "tfoot" x y) + +tfoot' :: Sig s opq +tfoot' = PwElement "tfoot" + +tfoot_ :: AFSig_ s opq +tfoot_ x = (\_ -> PwElement "tfoot" dats x) + +tfoot'_ :: Sig_ s opq +tfoot'_ x = PwElement "tfoot" dats x + +tfoot__ :: AFSig__ s opq +tfoot__ x = (\_ -> PwElement "tfoot" dats [txt x]) + +tfoot'__ :: Sig__ s opq +tfoot'__ x = PwElement "tfoot" dats [txt x] + + +th :: AFSig s opq +th x y = (\_ -> PwElement "th" x y) + +th' :: Sig s opq +th' = PwElement "th" + +th_ :: AFSig_ s opq +th_ x = (\_ -> PwElement "th" dats x) + +th'_ :: Sig_ s opq +th'_ x = PwElement "th" dats x + +th__ :: AFSig__ s opq +th__ x = (\_ -> PwElement "th" dats [txt x]) + +th'__ :: Sig__ s opq +th'__ x = PwElement "th" dats [txt x] + + +thead :: AFSig s opq +thead x y = (\_ -> PwElement "thead" x y) + +thead' :: Sig s opq +thead' = PwElement "thead" + +thead_ :: AFSig_ s opq +thead_ x = (\_ -> PwElement "thead" dats x) + +thead'_ :: Sig_ s opq +thead'_ x = PwElement "thead" dats x + +thead__ :: AFSig__ s opq +thead__ x = (\_ -> PwElement "thead" dats [txt x]) + +thead'__ :: Sig__ s opq +thead'__ x = PwElement "thead" dats [txt x] + + +time :: AFSig s opq +time x y = (\_ -> PwElement "time" x y) + +time' :: Sig s opq +time' = PwElement "time" + +time_ :: AFSig_ s opq +time_ x = (\_ -> PwElement "time" dats x) + +time'_ :: Sig_ s opq +time'_ x = PwElement "time" dats x + +time__ :: AFSig__ s opq +time__ x = (\_ -> PwElement "time" dats [txt x]) + +time'__ :: Sig__ s opq +time'__ x = PwElement "time" dats [txt x] + + +title :: AFSig s opq +title x y = (\_ -> PwElement "title" x y) + +title' :: Sig s opq +title' = PwElement "title" + +title_ :: AFSig_ s opq +title_ x = (\_ -> PwElement "title" dats x) + +title'_ :: Sig_ s opq +title'_ x = PwElement "title" dats x + +title__ :: AFSig__ s opq +title__ x = (\_ -> PwElement "title" dats [txt x]) + +title'__ :: Sig__ s opq +title'__ x = PwElement "title" dats [txt x] + + +tr :: AFSig s opq +tr x y = (\_ -> PwElement "tr" x y) + +tr' :: Sig s opq +tr' = PwElement "tr" + +tr_ :: AFSig_ s opq +tr_ x = (\_ -> PwElement "tr" dats x) + +tr'_ :: Sig_ s opq +tr'_ x = PwElement "tr" dats x + +tr__ :: AFSig__ s opq +tr__ x = (\_ -> PwElement "tr" dats [txt x]) + +tr'__ :: Sig__ s opq +tr'__ x = PwElement "tr" dats [txt x] + + +track :: AFSig s opq +track x y = (\_ -> PwElement "track" x y) + +track' :: Sig s opq +track' = PwElement "track" + +track_ :: AFSig_ s opq +track_ x = (\_ -> PwElement "track" dats x) + +track'_ :: Sig_ s opq +track'_ x = PwElement "track" dats x + +track__ :: AFSig__ s opq +track__ x = (\_ -> PwElement "track" dats [txt x]) + +track'__ :: Sig__ s opq +track'__ x = PwElement "track" dats [txt x] + + +tt :: AFSig s opq +tt x y = (\_ -> PwElement "tt" x y) + +tt' :: Sig s opq +tt' = PwElement "tt" + +tt_ :: AFSig_ s opq +tt_ x = (\_ -> PwElement "tt" dats x) + +tt'_ :: Sig_ s opq +tt'_ x = PwElement "tt" dats x + +tt__ :: AFSig__ s opq +tt__ x = (\_ -> PwElement "tt" dats [txt x]) + +tt'__ :: Sig__ s opq +tt'__ x = PwElement "tt" dats [txt x] + + +u :: AFSig s opq +u x y = (\_ -> PwElement "u" x y) + +u' :: Sig s opq +u' = PwElement "u" + +u_ :: AFSig_ s opq +u_ x = (\_ -> PwElement "u" dats x) + +u'_ :: Sig_ s opq +u'_ x = PwElement "u" dats x + +u__ :: AFSig__ s opq +u__ x = (\_ -> PwElement "u" dats [txt x]) + +u'__ :: Sig__ s opq +u'__ x = PwElement "u" dats [txt x] + + +ul :: AFSig s opq +ul x y = (\_ -> PwElement "ul" x y) + +ul' :: Sig s opq +ul' = PwElement "ul" + +ul_ :: AFSig_ s opq +ul_ x = (\_ -> PwElement "ul" dats x) + +ul'_ :: Sig_ s opq +ul'_ x = PwElement "ul" dats x + +ul__ :: AFSig__ s opq +ul__ x = (\_ -> PwElement "ul" dats [txt x]) + +ul'__ :: Sig__ s opq +ul'__ x = PwElement "ul" dats [txt x] + + +var :: AFSig s opq +var x y = (\_ -> PwElement "var" x y) + +var' :: Sig s opq +var' = PwElement "var" + +var_ :: AFSig_ s opq +var_ x = (\_ -> PwElement "var" dats x) + +var'_ :: Sig_ s opq +var'_ x = PwElement "var" dats x + +var__ :: AFSig__ s opq +var__ x = (\_ -> PwElement "var" dats [txt x]) + +var'__ :: Sig__ s opq +var'__ x = PwElement "var" dats [txt x] + + +video :: AFSig s opq +video x y = (\_ -> PwElement "video" x y) + +video' :: Sig s opq +video' = PwElement "video" + +video_ :: AFSig_ s opq +video_ x = (\_ -> PwElement "video" dats x) + +video'_ :: Sig_ s opq +video'_ x = PwElement "video" dats x + +video__ :: AFSig__ s opq +video__ x = (\_ -> PwElement "video" dats [txt x]) + +video'__ :: Sig__ s opq +video'__ x = PwElement "video" dats [txt x] + + +wbr :: (s -> PwNode s opq) +wbr = (\_ -> PwElement "br" dats []) + +txt :: String -> (s -> PwNode s opq) +txt t = (\_ -> PwTextNode t) + +txt' :: String -> PwNode s opq +txt' = PwTextNode + + +h1 :: AFSig s opq +h1 x y = (\_ -> PwElement "h1" x y) + +h1' :: Sig s opq +h1' = PwElement "h1" + +h1_ :: AFSig_ s opq +h1_ x = (\_ -> PwElement "h1" dats x) + +h1'_ :: Sig_ s opq +h1'_ x = PwElement "h1" dats x + +h1__ :: AFSig__ s opq +h1__ x = (\_ -> PwElement "h1" dats [txt x]) + +h1'__ :: Sig__ s opq +h1'__ x = PwElement "h1" dats [txt x] + + +h2 :: AFSig s opq +h2 x y = (\_ -> PwElement "h2" x y) + +h2' :: Sig s opq +h2' = PwElement "h2" + +h2_ :: AFSig_ s opq +h2_ x = (\_ -> PwElement "h2" dats x) + +h2'_ :: Sig_ s opq +h2'_ x = PwElement "h2" dats x + +h2__ :: AFSig__ s opq +h2__ x = (\_ -> PwElement "h2" dats [txt x]) + +h2'__ :: Sig__ s opq +h2'__ x = PwElement "h2" dats [txt x] + + +h3 :: AFSig s opq +h3 x y = (\_ -> PwElement "h3" x y) + +h3' :: Sig s opq +h3' = PwElement "h3" + +h3_ :: AFSig_ s opq +h3_ x = (\_ -> PwElement "h3" dats x) + +h3'_ :: Sig_ s opq +h3'_ x = PwElement "h3" dats x + +h3__ :: AFSig__ s opq +h3__ x = (\_ -> PwElement "h3" dats [txt x]) + +h3'__ :: Sig__ s opq +h3'__ x = PwElement "h3" dats [txt x] + + +h4 :: AFSig s opq +h4 x y = (\_ -> PwElement "h4" x y) + +h4' :: Sig s opq +h4' = PwElement "h4" + +h4_ :: AFSig_ s opq +h4_ x = (\_ -> PwElement "h4" dats x) + +h4'_ :: Sig_ s opq +h4'_ x = PwElement "h4" dats x + +h4__ :: AFSig__ s opq +h4__ x = (\_ -> PwElement "h4" dats [txt x]) + +h4'__ :: Sig__ s opq +h4'__ x = PwElement "h4" dats [txt x] + + +h5 :: AFSig s opq +h5 x y = (\_ -> PwElement "h5" x y) + +h5' :: Sig s opq +h5' = PwElement "h5" + +h5_ :: AFSig_ s opq +h5_ x = (\_ -> PwElement "h5" dats x) + +h5'_ :: Sig_ s opq +h5'_ x = PwElement "h5" dats x + +h5__ :: AFSig__ s opq +h5__ x = (\_ -> PwElement "h5" dats [txt x]) + +h5'__ :: Sig__ s opq +h5'__ x = PwElement "h5" dats [txt x] + + +h6 :: AFSig s opq +h6 x y = (\_ -> PwElement "h6" x y) + +h6' :: Sig s opq +h6' = PwElement "h6" + +h6_ :: AFSig_ s opq +h6_ x = (\_ -> PwElement "h6" dats x) + +h6'_ :: Sig_ s opq +h6'_ x = PwElement "h6" dats x + +h6__ :: AFSig__ s opq +h6__ x = (\_ -> PwElement "h6" dats [txt x]) + +h6'__ :: Sig__ s opq +h6'__ x = PwElement "h6" dats [txt x]
src/Web/Framework/Plzwrk/Util.hs view
@@ -1,23 +1,6 @@ module Web.Framework.Plzwrk.Util - ( (<.>) - , wStyle - , wStyle' - , wStyles - , wStyles' - , wClass - , wClass' - , wClasses - , wClasses' - , wOnClick - , wOnClick' - , wId - , wId' - , wOnInput - , wOnInput' - , wAttr - , wAttr' - , wAttrs - , wAttrs' + ( pT + , pF , eventTargetValue , eventPreventDefault , eventTargetBlur @@ -44,98 +27,17 @@ import Data.Set as S import Web.Framework.Plzwrk.Base ( dats , dats' - , Attributes(..) + , PwAttribute(..) ) import Web.Framework.Plzwrk.Browserful -merge :: Attributes s opq -> Attributes s opq -> Attributes s opq -merge a b = MkAttributes { _style = HM.union (_style a) (_style b) - , _class = S.union (_class a) (_class b) - , _simple = HM.union (_simple a) (_simple b) - , _handlers = HM.union (_handlers a) (_handlers b) - } - --- |Merges two 'Attributes' -(<.>) - :: (s -> Attributes s opq) - -> (s -> Attributes s opq) - -> (s -> Attributes s opq) -a <.> b = (\s -> merge (a s) (b s)) - --- |Constrcts a stateful 'Attributes' applicative functor from a single style. -wStyle :: String -> String -> (s -> Attributes s opq) -wStyle k v = (\s -> dats' { _style = HM.singleton k v }) - --- |Constrcts an 'Attributes' from a single style. -wStyle' :: String -> String -> Attributes s opq -wStyle' k v = dats' { _style = HM.singleton k v } - --- |Constrcts a stateful 'Attributes' applicative functor from a list of styles. -wStyles :: [(String, String)] -> (s -> Attributes s opq) -wStyles kvs = (\s -> dats' { _style = HM.fromList kvs }) - --- |Constrcts an 'Attributes' from a list of styles. -wStyles' :: [(String, String)] -> Attributes s opq -wStyles' kvs = dats' { _style = HM.fromList kvs } - --- |Constrcts a stateful 'Attributes' applicative functor from a single class. -wClass :: String -> (s -> Attributes s opq) -wClass k = (\s -> dats' { _class = S.singleton k }) - --- |Constrcts an 'Attributes' from a single class. -wClass' :: String -> Attributes s opq -wClass' k = dats' { _class = S.singleton k } - --- |Constrcts a stateful 'Attributes' applicative functor from a list of clases. -wClasses :: [String] -> (s -> Attributes s opq) -wClasses ks = (\s -> dats' { _class = S.fromList ks }) - --- |Constrcts an 'Attributes' from a list of classes. -wClasses' :: [String] -> Attributes s opq -wClasses' ks = dats' { _class = S.fromList ks } - --- |Constrcts a stateful 'Attributes' applicative functor with a given id. -wId :: String -> (s -> Attributes s opq) -wId v = (\s -> dats' { _simple = HM.singleton "id" v }) - --- |Constrcts an 'Attributes' with a given id. -wId' :: String -> Attributes s opq -wId' v = dats' { _simple = HM.singleton "id" v } - --- |Constrcts a stateful 'Attributes' applicative functor from an @onClick@ callback. -wOnClick :: (opq -> s -> IO s) -> (s -> Attributes s opq) -wOnClick v = (\s -> dats' { _handlers = HM.singleton "click" v }) - --- |Constrcts an 'Attributes' from an @onClick@ callback. -wOnClick' :: (opq -> s -> IO s) -> Attributes s opq -wOnClick' v = dats' { _handlers = HM.singleton "click" v } - --- |Constrcts a stateful 'Attributes' applicative functor from an @onInput@ callback. -wOnInput :: (opq -> s -> IO s) -> (s -> Attributes s opq) -wOnInput v = (\s -> dats' { _handlers = HM.singleton "input" v }) - --- |Constrcts an 'Attributes' from an @onInput@ callback. -wOnInput' :: (opq -> s -> IO s) -> Attributes s opq -wOnInput' v = dats' { _handlers = HM.singleton "input" v } - --- |Constrcts a stateful 'Attributes' applicative functor from a single attribute. -wAttr :: String -> String -> (s -> Attributes s opq) -wAttr k v = (\s -> dats' { _simple = HM.singleton k v }) - --- |Constrcts an 'Attributes' from a single attribute. -wAttr' :: String -> String -> Attributes s opq -wAttr' k v = dats' { _simple = HM.singleton k v } - --- |Constrcts a stateful 'Attributes' applicative functor from a list of attributes. -wAttrs :: [(String, String)] -> (s -> Attributes s opq) -wAttrs kvs = (\s -> dats' { _simple = HM.fromList kvs }) - --- |Constrcts an 'Attributes' from a list of attributes. -wAttrs' :: [(String, String)] -> Attributes s opq -wAttrs' kvs = dats' { _simple = HM.fromList kvs } +-- | Creates a text attribute wrapped in an applicative functor +pT :: String -> (s -> PwAttribute s opq) +pT t = (\_ -> PwTextAttribute t) ------------------------------ ----- events +-- | Creates a callback attribute wrapped in an applicative functor +pF :: (opq -> s -> IO s) -> (s -> PwAttribute s opq) +pF f = (\_ -> PwFunctionAttribute f) -- |From an event, gets the target's value. eventTargetValue
+ test/DOMSpec.hs view
@@ -0,0 +1,110 @@+module DOMSpec ( domSpec ) where + +import Control.Monad +import Control.Monad.Reader +import Data.IORef +import Prelude hiding ( div ) +import Test.Hspec +import Web.Framework.Plzwrk +import Web.Framework.Plzwrk.MockJSVal +import Data.HashMap.Strict +import Web.Framework.Plzwrk.Tag ( p + , br + , txt + , button + , div'_ + ) + +nodeChildNodesOrThrow :: Browserful jsval -> jsval -> IO [jsval] +nodeChildNodesOrThrow b v = do + _v <- (nodeChildNodes b v) + maybe (error "Could not find child nodes") pure _v + +nodeTextContentOrThrow :: Browserful jsval -> jsval -> IO String +nodeTextContentOrThrow b v = do + _v <- (nodeTextContent b v) + maybe (error "Could not find text content") pure _v + +elementTagNameOrThrow :: Browserful jsval -> jsval -> IO String +elementTagNameOrThrow b v = do + _v <- (elementTagName b v) + maybe (error "Could not find tag name") pure _v + +data MyState = MyState + { _name :: String + , _ctr :: Int + } + +domSpec = describe "Element with basic state" $ do + let domF = + (\x y -> div'_ + [ p [("style", pT "position:absolute")] + (take y $ repeat (txt (concat [x, show y]))) + , button + [("id", pT "incr"), ("class", pT "a b ccc"), ("click", + pF (\_ s -> pure $ s { _ctr = y + 1 }) + )] + [txt "Increase counter"] + , br + ,button + [("id", pT "decr"), ("style", pT "position:absolute;margin:10px") + , ("click", pF (\_ s -> pure $ s { _ctr = y - 1 }))] + [txt "Decrease counter"] + ] + ) + <$> _name + <*> _ctr + let state = MyState "Mike" 1 + it "Creates the correct DOM from the state" $ do + rf <- defaultInternalBrowser + mock <- makeMockBrowserWithContext rf + plzwrk' domF state mock + parentNode <- documentBody mock + childrenLevel0 <- (nodeChildNodesOrThrow mock) parentNode + length childrenLevel0 `shouldBe` 1 + divtag <- (elementTagNameOrThrow mock) (head childrenLevel0) + divtag `shouldBe` "div" + childrenLevel1 <- (nodeChildNodesOrThrow mock) (head childrenLevel0) + length childrenLevel1 `shouldBe` 4 + ptag <- (elementTagNameOrThrow mock) (head childrenLevel1) + ptag `shouldBe` "p" + childrenLevel2 <- (nodeChildNodesOrThrow mock) (head childrenLevel1) + length childrenLevel2 `shouldBe` 1 + + -- increment 4 times + + (documentGetElementById mock) "incr" + >>= maybe (error "Incr node does not exist") (htmlElemenetClick mock) + (documentGetElementById mock) "incr" + >>= maybe (error "Incr node does not exist") (htmlElemenetClick mock) + (documentGetElementById mock) "incr" + >>= maybe (error "Incr node does not exist") (htmlElemenetClick mock) + (documentGetElementById mock) "incr" + >>= maybe (error "Incr node does not exist") (htmlElemenetClick mock) + parentNode' <- documentBody mock + childrenLevel0' <- (nodeChildNodesOrThrow mock) parentNode' + length childrenLevel0' `shouldBe` 1 + divtag' <- (elementTagNameOrThrow mock) (head childrenLevel0') + divtag' `shouldBe` "div" + childrenLevel1' <- (nodeChildNodesOrThrow mock) (head childrenLevel0') + length childrenLevel1' `shouldBe` 4 + childrenLevel2' <- (nodeChildNodesOrThrow mock) (head childrenLevel1') + length childrenLevel2' `shouldBe` 5 + content' <- mapM (nodeTextContentOrThrow mock) childrenLevel2' + content' `shouldBe` (take 5 $ repeat "Mike5") + (documentGetElementById mock) "decr" + >>= maybe (error "Incr node does not exist") (htmlElemenetClick mock) + (documentGetElementById mock) "decr" + >>= maybe (error "Incr node does not exist") (htmlElemenetClick mock) + parentNode'' <- documentBody mock + childrenLevel0'' <- (nodeChildNodesOrThrow mock) parentNode'' + length childrenLevel0'' `shouldBe` 1 + divtag'' <- (elementTagNameOrThrow mock) (head childrenLevel0'') + divtag'' `shouldBe` "div" + childrenLevel1'' <- (nodeChildNodesOrThrow mock) (head childrenLevel0'') + length childrenLevel1'' `shouldBe` 4 + childrenLevel2'' <- (nodeChildNodesOrThrow mock) (head childrenLevel1'') + length childrenLevel2'' `shouldBe` 3 + content'' <- mapM (nodeTextContentOrThrow mock) childrenLevel2'' + content'' `shouldBe` (take 3 $ repeat "Mike3") + toHTML domF state `shouldBe` "<div><p style=\"position:absolute\">Mike1</p><button id=\"incr\" class=\"a b ccc\">Increase counter</button><br/><button id=\"decr\" style=\"position:absolute;margin:10px\">Decrease counter</button></div>"
+ test/HSXSpec.hs view
@@ -0,0 +1,56 @@+{-# LANGUAGE QuasiQuotes #-}++module HSXSpec+ ( hsxSpec+ )+where++import Control.Monad+import qualified Data.HashMap.Strict as HM+import Control.Monad.Reader+import Data.IORef+import Test.Hspec+import Web.Framework.Plzwrk++hsxSpec = describe "HSXParser" $ do+ it "Parses simple hsx" $ do+ let dom = [hsx|<p>Hello world!</p>|]+ -- we use () for an empty state++ _elt_tag (dom ()) `shouldBe` "p"+ _tn_text (((_elt_children (dom ())) !! 0) ()) `shouldBe` "Hello world!"+ it "Parses hsx with an event listener" $ do+ let dom = [hsx|+ <h1 id="foo" style="position:absolute">+ <a click=#c{(\_ x -> return $ x + 41)}#>Hello</a>+ </h1>+ |]+ _elt_tag (dom 3) `shouldBe` "h1"+ _elt_tag (((_elt_children (dom 5)) !! 0) 3) `shouldBe` "a"+ let attrs = (_elt_attrs (((_elt_children (dom 1)) !! 0) 1))+ let clickAttr = (filter (\(x, _) -> x == "click") attrs) !! 0+ let mf (PwFunctionAttribute f) = f+ let cf = mf ((snd clickAttr) 0)+ res <- cf () 1+ res `shouldBe` 42+ it "Parses hsx with sub-hsx" $ do+ let mylink = [hsx|<a click=#c{(\_ x -> return $ x + 41)}#>Hello</a>|]+ let dom = [hsx|+ <h1 id="foo" style="position:absolute">+ #e{mylink}#+ #t{"hello world"}#+ </h1>+ |]+ _elt_tag (dom 3) `shouldBe` "h1"+ _elt_tag (((_elt_children (dom 5)) !! 0) 3) `shouldBe` "a"+ _tn_text (((_elt_children (dom 5)) !! 1) 3) `shouldBe` "hello world"+ 1 `shouldBe` 1+ it "Parses hsx'" $ do+ let mylink = [hsx|<a click=#c{(\_ x -> return $ x + 41)}#>Hello</a>|]+ let dom = (\st -> [hsx'|+ <h1 id="foo" style=#t{"position:absolute"}#>+ #e{mylink}#+ </h1>+ |])+ _elt_tag (dom 3) `shouldBe` "h1"+ _elt_tag (((_elt_children (dom 5)) !! 0) 3) `shouldBe` "a"
test/Spec.hs view
@@ -1,112 +1,8 @@-import Control.Monad -import Control.Monad.Reader -import Data.IORef -import Prelude hiding ( div ) +import DOMSpec ( domSpec ) +import HSXSpec ( hsxSpec ) import Test.Hspec -import Web.Framework.Plzwrk -import Web.Framework.Plzwrk.MockJSVal -import Data.HashMap.Strict -import Web.Framework.Plzwrk.Tag ( p - , br - , txt - , button - , div'_ - ) -nodeChildNodesOrThrow :: Browserful jsval -> jsval -> IO [jsval] -nodeChildNodesOrThrow b v = do - _v <- (nodeChildNodes b v) - maybe (error "Could not find child nodes") pure _v - -nodeTextContentOrThrow :: Browserful jsval -> jsval -> IO String -nodeTextContentOrThrow b v = do - _v <- (nodeTextContent b v) - maybe (error "Could not find text content") pure _v - -elementTagNameOrThrow :: Browserful jsval -> jsval -> IO String -elementTagNameOrThrow b v = do - _v <- (elementTagName b v) - maybe (error "Could not find tag name") pure _v - -data MyState = MyState - { _name :: String - , _ctr :: Int - } - main :: IO () main = hspec $ do - describe "Element with basic state" $ do - let domF = - (\x y -> div'_ - [ p (wStyle "position" "absolute") - (take y $ repeat (txt (concat [x, show y]))) - , button - (wId "incr" <.> wClasses ["a b ccc"] <.> wOnClick - (\_ s -> pure $ s { _ctr = y + 1 }) - ) - [txt "Increase counter"] - , br - ,button - ( wId "decr" - <.> wStyles [("position", "absolute"), ("margin", "10px")] - <.> wOnClick (\_ s -> pure $ s { _ctr = y - 1 }) - ) - [txt "Decrease counter"] - ] - ) - <$> _name - <*> _ctr - let state = MyState "Mike" 1 - it "Creates the correct DOM from the state" $ do - rf <- defaultInternalBrowser - mock <- makeMockBrowserWithContext rf - plzwrk' domF state mock - parentNode <- documentBody mock - childrenLevel0 <- (nodeChildNodesOrThrow mock) parentNode - length childrenLevel0 `shouldBe` 1 - divtag <- (elementTagNameOrThrow mock) (head childrenLevel0) - divtag `shouldBe` "div" - childrenLevel1 <- (nodeChildNodesOrThrow mock) (head childrenLevel0) - length childrenLevel1 `shouldBe` 4 - ptag <- (elementTagNameOrThrow mock) (head childrenLevel1) - ptag `shouldBe` "p" - childrenLevel2 <- (nodeChildNodesOrThrow mock) (head childrenLevel1) - length childrenLevel2 `shouldBe` 1 - - -- increment 4 times - - (documentGetElementById mock) "incr" - >>= maybe (error "Incr node does not exist") (htmlElemenetClick mock) - (documentGetElementById mock) "incr" - >>= maybe (error "Incr node does not exist") (htmlElemenetClick mock) - (documentGetElementById mock) "incr" - >>= maybe (error "Incr node does not exist") (htmlElemenetClick mock) - (documentGetElementById mock) "incr" - >>= maybe (error "Incr node does not exist") (htmlElemenetClick mock) - parentNode' <- documentBody mock - childrenLevel0' <- (nodeChildNodesOrThrow mock) parentNode' - length childrenLevel0' `shouldBe` 1 - divtag' <- (elementTagNameOrThrow mock) (head childrenLevel0') - divtag' `shouldBe` "div" - childrenLevel1' <- (nodeChildNodesOrThrow mock) (head childrenLevel0') - length childrenLevel1' `shouldBe` 4 - childrenLevel2' <- (nodeChildNodesOrThrow mock) (head childrenLevel1') - length childrenLevel2' `shouldBe` 5 - content' <- mapM (nodeTextContentOrThrow mock) childrenLevel2' - content' `shouldBe` (take 5 $ repeat "Mike5") - (documentGetElementById mock) "decr" - >>= maybe (error "Incr node does not exist") (htmlElemenetClick mock) - (documentGetElementById mock) "decr" - >>= maybe (error "Incr node does not exist") (htmlElemenetClick mock) - parentNode'' <- documentBody mock - childrenLevel0'' <- (nodeChildNodesOrThrow mock) parentNode'' - length childrenLevel0'' `shouldBe` 1 - divtag'' <- (elementTagNameOrThrow mock) (head childrenLevel0'') - divtag'' `shouldBe` "div" - childrenLevel1'' <- (nodeChildNodesOrThrow mock) (head childrenLevel0'') - length childrenLevel1'' `shouldBe` 4 - childrenLevel2'' <- (nodeChildNodesOrThrow mock) (head childrenLevel1'') - length childrenLevel2'' `shouldBe` 3 - content'' <- mapM (nodeTextContentOrThrow mock) childrenLevel2'' - content'' `shouldBe` (take 3 $ repeat "Mike3") - toHTML domF state `shouldBe` "<div><p style=\"position:absolute\">Mike1</p><button class=\"a b ccc\" id=\"incr\">Increase counter</button><br/><button style=\"margin:10px;position:absolute\" id=\"decr\">Decrease counter</button></div>" + domSpec + hsxSpec