@@ -425,6 +425,7 @@ data SelectElement er d t = SelectElement
425425#ifdef USE_TEMPLATE_HASKELL
426426concat <$> mapM (uncurry makeLensesWithoutField)
427427 [ (["_textNodeConfig_setContents"], ''TextNodeConfig)
428+ , (["_commentNodeConfig_setContents"], ''CommentNodeConfig)
428429 , ([ "_inputElementConfig_setValue"
429430 , "_inputElementConfig_setChecked" ], ''InputElementConfig)
430431 , (["_rawElementConfig_modifyAttributes"], ''RawElementConfig)
@@ -441,6 +442,13 @@ textNodeConfig_setContents =
441442 setter t e = t { _textNodeConfig_setContents = Just e }
442443 in lens getter setter
443444
445+-- | This lens is technically illegal. The implementation of 'TextNodeConfig' uses a 'Maybe' under the hood for efficiency reasons. However, always interacting with 'TextNodeConfig' via lenses will always behave correctly, and if you pattern match on it, you should always treat 'Nothing' as 'never'.
446+commentNodeConfig_setContents :: Reflex t => Lens (CommentNodeConfig t) (CommentNodeConfig t) (Event t Text) (Event t Text)
447+commentNodeConfig_setContents =
448+ let getter = fromMaybe never . _commentNodeConfig_setContents
449+ setter t e = t { _commentNodeConfig_setContents = Just e }
450+ in lens getter setter
451+
444452-- | This lens is technically illegal. The implementation of 'InputElementConfig' uses a 'Maybe' under the hood for efficiency reasons. However, always interacting with 'InputElementConfig' via lenses will always behave correctly, and if you pattern match on it, you should always treat 'Nothing' as 'never'.
445453inputElementConfig_setValue :: Reflex t => Lens (InputElementConfig er t m) (InputElementConfig er t m) (Event t Text) (Event t Text)
446454inputElementConfig_setValue =
@@ -553,6 +561,7 @@ instance (MountableDomBuilder t m, PerformEvent t m, MonadFix m, MonadHold t m)
553561instance (DomBuilder t m, Monoid w, MonadHold t m, MonadFix m) => DomBuilder t (DynamicWriterT t w m) where
554562 type DomBuilderSpace (DynamicWriterT t w m) = DomBuilderSpace m
555563 textNode = liftTextNode
564+ commentNode = liftCommentNode
556565 element elementTag cfg (DynamicWriterT child) = DynamicWriterT $ do
557566 s <- get
558567 (el, (a, newS)) <- lift $ element elementTag cfg $ runStateT child s
@@ -571,6 +580,7 @@ instance (DomBuilder t m, Monoid w, MonadHold t m, MonadFix m) => DomBuilder t (
571580instance (DomBuilder t m, MonadHold t m, MonadFix m) => DomBuilder t (RequesterT t request response m) where
572581 type DomBuilderSpace (RequesterT t request response m) = DomBuilderSpace m
573582 textNode = liftTextNode
583+ commentNode = liftCommentNode
574584 element elementTag cfg (RequesterT child) = RequesterT $ do
575585 r <- ask
576586 old <- get
@@ -591,6 +601,7 @@ instance (DomBuilder t m, MonadHold t m, MonadFix m) => DomBuilder t (RequesterT
591601instance (DomBuilder t m, MonadHold t m, MonadFix m, Semigroup w) => DomBuilder t (EventWriterT t w m) where
592602 type DomBuilderSpace (EventWriterT t w m) = DomBuilderSpace m
593603 textNode = liftTextNode
604+ commentNode = liftCommentNode
594605 element elementTag cfg (EventWriterT child) = EventWriterT $ do
595606 old <- get
596607 (el, (a, new)) <- lift $ element elementTag cfg $ runStateT child old
@@ -609,6 +620,7 @@ instance (DomBuilder t m, MonadHold t m, MonadFix m, Semigroup w) => DomBuilder
609620instance (DomBuilder t m, MonadFix m, MonadHold t m, Group q, Query q, Additive q) => DomBuilder t (QueryT t q m) where
610621 type DomBuilderSpace (QueryT t q m) = DomBuilderSpace m
611622 textNode = liftTextNode
623+ commentNode = liftCommentNode
612624 element elementTag cfg (QueryT child) = QueryT $ do
613625 s <- get
614626 (e, (a, newS)) <- lift $ element elementTag cfg $ runStateT child s
@@ -677,6 +689,9 @@ liftWithStateless a = liftWith $ \run -> a $ fmap (fromStT (Proxy :: Proxy t)) .
677689liftTextNode :: (MonadTrans f, DomBuilder t m) => TextNodeConfig t -> f m (TextNode (DomBuilderSpace m) t)
678690liftTextNode = lift . textNode
679691
692+liftCommentNode :: (MonadTrans f, DomBuilder t m) => CommentNodeConfig t -> f m (CommentNode (DomBuilderSpace m) t)
693+liftCommentNode = lift . commentNode
694+
680695liftElement :: LiftDomBuilder t f m => Text -> ElementConfig er t (DomBuilderSpace m) -> f m a -> f m (Element er (DomBuilderSpace m) t, a)
681696liftElement elementTag cfg child = liftWithStateless $ \run -> element elementTag cfg $ run child
682697