Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various fixes for ghc 9 and stackage-nightly compat #433

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions reflex-dom-core/reflex-dom-core.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,15 @@ library
hs-source-dirs: src
build-depends:
aeson >= 0.8 && < 2.2,
base >= 4.7 && < 4.15,
base >= 4.7 && < 4.20,
bifunctors >= 4.2 && < 6,
bimap >= 0.3 && < 0.5,
bimap >= 0.3 && < 0.6,
blaze-builder >= 0.4.1 && < 0.5,
bytestring == 0.10.*,
bytestring >= 0.10 && <= 0.12,
case-insensitive < 1.3,
commutative-semigroups >=0.1 && <0.2,
containers >= 0.6 && < 0.7,
constraints >= 0.9 && < 0.14,
constraints >= 0.9 && < 0.15,
contravariant >= 1.4 && < 1.6,
data-default >= 0.5 && < 0.8,
dependent-map >= 0.3 && < 0.5,
Expand All @@ -90,15 +90,15 @@ library
keycode >= 0.2.1 && < 0.3,
lens >= 4.7 && < 5.3,
monad-control >= 1.0.1 && < 1.1,
mtl >= 2.1 && < 2.3,
primitive >= 0.5 && < 0.8,
mtl >= 2.1 && < 2.4,
primitive >= 0.5 && < 0.9,
random >= 1.1 && < 1.3,
ref-tf >= 0.4 && < 0.6,
reflex >= 0.8.2.1 && < 1,
semigroups >= 0.16 && < 0.20,
semigroups >= 0.16 && < 0.21,
stm >= 2.4 && < 2.6,
text == 1.2.*,
transformers >= 0.3 && < 0.6,
text >= 1.2 && < 2.1,
transformers >= 0.3 && < 0.7,
network-uri >= 2.6.1 && < 2.7,
zenc == 0.1.*

Expand All @@ -110,11 +110,11 @@ library
else
hs-source-dirs: src-ghc
if !os(windows)
build-depends: unix == 2.7.*
build-depends: unix >= 2.7 && < 2.9

if flag(split-these)
build-depends:
semialign >= 1 && < 1.3,
semialign >= 1 && < 1.4,
these >= 1 && < 1.3
else
build-depends:
Expand Down Expand Up @@ -170,7 +170,7 @@ library
if flag(use-template-haskell)
build-depends:
dependent-sum-template >= 0.1 && < 0.2,
template-haskell >= 2.12.0 && < 2.17
template-haskell >= 2.12.0 && < 2.21
other-extensions: TemplateHaskell
cpp-options: -DUSE_TEMPLATE_HASKELL
other-modules:
Expand Down
19 changes: 10 additions & 9 deletions reflex-dom-core/src/Reflex/Dom/Builder/Class.hs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ import Control.Monad.Reader
import qualified Control.Monad.State as Lazy
import Control.Monad.State.Strict
import Control.Monad.Trans.Control
import Control.Monad.Fix
import Data.Default
import Data.Functor.Misc
import Data.Map (Map)
Expand Down Expand Up @@ -278,6 +279,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 +552,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
2 changes: 2 additions & 0 deletions reflex-dom-core/src/Reflex/Dom/Builder/Immediate.hs
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ import Control.Monad.Primitive
import Control.Monad.Reader
import Control.Monad.Ref
import Control.Monad.State.Strict (StateT, mapStateT, get, modify', gets, runStateT)
import Control.Monad.Fix
import Control.Monad
import Data.Bitraversable
import Data.Default
import Data.Dependent.Map (DMap)
Expand Down
2 changes: 2 additions & 0 deletions reflex-dom-core/src/Reflex/Dom/Builder/Static.hs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ import Control.Monad.Exception
import Control.Monad.Identity
import Control.Monad.Primitive
import Control.Monad.Ref
import Control.Monad
import Control.Monad.Fix
import Control.Monad.State.Strict
import Control.Monad.Trans.Reader
import Data.ByteString (ByteString)
Expand Down
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
2 changes: 2 additions & 0 deletions reflex-dom-core/src/Reflex/Dom/Prerender.hs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ module Reflex.Dom.Prerender

import Control.Monad.Primitive (PrimMonad(..))
import Control.Monad.Reader
import Control.Monad
import Control.Monad.Fix
import Control.Monad.Ref (MonadRef(..), MonadAtomicRef(..))
import Data.IORef (IORef, newIORef)
import Data.Semigroup (Semigroup)
Expand Down
1 change: 1 addition & 0 deletions reflex-dom-core/src/Reflex/Dom/WebSocket.hs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ import Control.Lens
import Control.Monad hiding (forM, forM_, mapM, mapM_, sequence)
import Control.Monad.IO.Class
import Control.Monad.State
import Control.Monad
import Data.Aeson
import Data.ByteString (ByteString)
import Data.ByteString.Lazy (toStrict)
Expand Down
1 change: 1 addition & 0 deletions reflex-dom-core/src/Reflex/Dom/Widget/Basic.hs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ import Reflex.Workflow
import Control.Arrow
import Control.Lens hiding (children, element)
import Control.Monad.Reader hiding (forM, forM_, mapM, mapM_, sequence, sequence_)
import Control.Monad.Fix
import Data.Align
import Data.Default
import Data.Either
Expand Down
1 change: 1 addition & 0 deletions reflex-dom-core/src/Reflex/Dom/Widget/Input.hs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import Prelude

import Control.Lens hiding (element, ix)
import Control.Monad.Fix
import Control.Monad
import Control.Monad.IO.Class
import Control.Monad.Reader
import qualified Data.Bimap as Bimap
Expand Down
6 changes: 3 additions & 3 deletions reflex-dom/reflex-dom.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,11 @@ library
cpp-options: -DANDROID
build-tools: hsc2hs
build-depends:
base >= 4.7 && < 4.15,
bytestring == 0.10.*,
base >= 4.7 && < 4.20,
bytestring >= 0.10 && <= 0.12,
reflex >= 0.8 && < 1,
reflex-dom-core >= 0.6.1.0 && <0.9,
text == 1.2.*
text >= 1.2 && < 2.1
if !impl(ghcjs)
if flag(use-warp)
build-depends:
Expand Down
Loading