Skip to content

Commit

Permalink
reflex-dom-core: Reorder instance because of TH for ghc 9.0
Browse files Browse the repository at this point in the history
ghc 9 is pickier regarding the order of TH statements
  • Loading branch information
maralorn committed Mar 11, 2024
1 parent 5d1dbde commit aad7816
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions reflex-dom-core/src/Reflex/Dom/Builder/Class.hs
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,15 @@ elementConfig_eventSpec f (ElementConfig a b c d) = (\d' -> ElementConfig a b c
{-# INLINE elementConfig_eventSpec #-}
#endif

instance (Reflex t, er ~ EventResult, DomSpace s) => Default (ElementConfig er t s) where
{-# INLINABLE def #-}
def = ElementConfig
{ _elementConfig_namespace = Nothing
, _elementConfig_initialAttributes = mempty
, _elementConfig_modifyAttributes = Nothing
, _elementConfig_eventSpec = def
}

data Element er d t
= Element { _element_events :: EventSelector t (WrapArg er EventName) --TODO: EventSelector should have two arguments
, _element_raw :: RawElement d
Expand Down Expand Up @@ -542,15 +551,6 @@ instance HasNamespace (ElementConfig er t m) where
{-# INLINABLE namespace #-}
namespace = elementConfig_namespace

instance (Reflex t, er ~ EventResult, DomSpace s) => Default (ElementConfig er t s) where
{-# INLINABLE def #-}
def = ElementConfig
{ _elementConfig_namespace = Nothing
, _elementConfig_initialAttributes = mempty
, _elementConfig_modifyAttributes = Nothing
, _elementConfig_eventSpec = def
}

instance (DomBuilder t m, PerformEvent t m, MonadFix m, MonadHold t m) => DomBuilder t (PostBuildT t m) where
type DomBuilderSpace (PostBuildT t m) = DomBuilderSpace m
wrapRawElement e = lift . wrapRawElement e
Expand Down

0 comments on commit aad7816

Please sign in to comment.