Skip to content

Commit

Permalink
reflex-dom-core: Eta expand some functions to appease the ghc 9 typec…
Browse files Browse the repository at this point in the history
…hecker

This is a sad change, because hlint will complain about the unnecessary
eta expansion.

The problem is that ghc 9 will not unify the forall x. x with () in an
argument position. Although obviously a supplied value of the type
forall x. WidgetT x () can be used as a WidgetT () ().

eta expanding helps the type checker to agree with this.
  • Loading branch information
maralorn committed Mar 11, 2024
1 parent aad7816 commit f5901c8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions reflex-dom-core/src/Reflex/Dom/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ import Reflex.Profiled

{-# INLINE mainHydrationWidgetWithHead #-}
mainHydrationWidgetWithHead :: (forall x. HydrationWidget x ()) -> (forall x. HydrationWidget x ()) -> JSM ()
mainHydrationWidgetWithHead = mainHydrationWidgetWithHead'
mainHydrationWidgetWithHead x y = mainHydrationWidgetWithHead' x y

{-# INLINABLE mainHydrationWidgetWithHead' #-}
-- | Warning: `mainHydrationWidgetWithHead'` is provided only as performance tweak. It is expected to disappear in future releases.
Expand All @@ -67,7 +67,7 @@ mainHydrationWidgetWithHead' = mainHydrationWidgetWithSwitchoverAction' (pure ()

{-# INLINE mainHydrationWidgetWithSwitchoverAction #-}
mainHydrationWidgetWithSwitchoverAction :: JSM () -> (forall x. HydrationWidget x ()) -> (forall x. HydrationWidget x ()) -> JSM ()
mainHydrationWidgetWithSwitchoverAction = mainHydrationWidgetWithSwitchoverAction'
mainHydrationWidgetWithSwitchoverAction x y z = mainHydrationWidgetWithSwitchoverAction' x y z

{-# INLINABLE mainHydrationWidgetWithSwitchoverAction' #-}
-- | Warning: `mainHydrationWidgetWithSwitchoverAction'` is provided only as performance tweak. It is expected to disappear in future releases.
Expand Down Expand Up @@ -187,7 +187,7 @@ runHydrationWidgetWithHeadAndBodyWithFailure onFailure switchoverAction app = wi

{-# INLINE mainWidget #-}
mainWidget :: (forall x. Widget x ()) -> JSM ()
mainWidget = mainWidget'
mainWidget x = mainWidget' x

{-# INLINABLE mainWidget' #-}
-- | Warning: `mainWidget'` is provided only as performance tweak. It is expected to disappear in future releases.
Expand Down

0 comments on commit f5901c8

Please sign in to comment.