Skip to content

Commit f245501

Browse files
committed
Remap the input too during 'renderWidget'
1 parent e0532a9 commit f245501

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/Halogen/VDom/Types.purs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,13 @@ instance bifunctorVDom ∷ Bifunctor VDom where
4444
-- | `VDom` nodes.
4545
-- |
4646
-- | Using this function will fuse any `Graft`s present in the `VDom`.
47-
renderWidget a w x. (w VDom a x) VDom a w VDom a x
48-
renderWidget f = case _ of
47+
renderWidget a b w x. (a b) (w VDom b x) VDom a w VDom b x
48+
renderWidget f g = case _ of
4949
Text a → Text a
50-
Elem ns n a ch → Elem ns n a (map (renderWidget f) ch)
51-
Keyed ns n a ch → Keyed ns n a (map (map (renderWidget f)) ch)
52-
Widget w → f w
53-
Grafted g → Grafted $ unGraft (\(Graft fa fw v) →
54-
graft (Graft identity identity (renderWidget f (bimap fa fw v)))) g
50+
Elem ns n a ch → Elem ns n (f a) (map (renderWidget f g) ch)
51+
Keyed ns n a ch → Keyed ns n (f a) (map (map (renderWidget f g)) ch)
52+
Widget w → g w
53+
Grafted gaw → renderWidget f g (runGraft gaw)
5554

5655
foreign import data GraftType Type Type
5756

0 commit comments

Comments
 (0)