on develop help sign in
Update for reflex-0.4, dependent-map-0.2.* and dependent-sum-0.3.*

Conflicts: src/Reflex/Dom/WebSocket.hs

commit88683f3541893af8cb51a7264e4628a5ed794ff9 authorCale Gibbard <cgibbard@gmail.com> dateSun 17 Jan 2016, 19:45 (11 years ago) parentd49e1cd
7 files changed+17−17
default.nix+1−1 reflex-dom.cabal+4−4 src/Reflex/Dom/Class.hs+3−3 src/Reflex/Dom/Internal.hs+1−1 src/Reflex/Dom/WebSocket.hs+2−2 src/Reflex/Dom/Widget/Basic.hs+2−2 src/Reflex/Dom/Widget/Input.hs+4−4
default.nix+1−1
@@ -7,7 +7,7 @@
77
88mkDerivation {
99 pname = "reflex-dom";
10− version = "0.2";
10+ version = "0.3";
1111 src = builtins.filterSource (path: type: baseNameOf path != ".git") ./.;
1212 buildDepends = [
1313 reflex
reflex-dom.cabal+4−4
@@ -1,5 +1,5 @@
11Name: reflex-dom
2−Version: 0.2
2+Version: 0.3
33Synopsis: Functional Reactive Web Apps with Reflex
44Description: Reflex-DOM is a Functional Reactive web framework based on the Reflex FRP engine
55License: BSD3
@@ -20,9 +20,9 @@ library
2020 hs-source-dirs: src
2121 build-depends:
2222 base >= 4.7 && < 4.9,
23− reflex == 0.3.*,
24− dependent-sum == 0.2.*,
25− dependent-map == 0.1.*,
23+ reflex == 0.4.*,
24+ dependent-sum == 0.3.*,
25+ dependent-map == 0.2.*,
2626 semigroups == 0.16.*,
2727 mtl >= 2.1 && < 2.3,
2828 containers == 0.5.*,
src/Reflex/Dom/Class.hs+3−3
@@ -77,13 +77,13 @@ instance MonadIORestore m => MonadIORestore (ReaderT r m) where
7777
7878class (MonadRef h, Ref h ~ Ref m, MonadRef m) => HasPostGui t h m | m -> t h where
7979 askPostGui :: m (h () -> IO ())
80− askRunWithActions :: m ([DSum (EventTrigger t)] -> h ())
80+ askRunWithActions :: m ([DSum (EventTrigger t) Identity] -> h ())
8181
8282runFrameWithTriggerRef :: (HasPostGui t h m, MonadRef m, MonadIO m) => Ref m (Maybe (EventTrigger t a)) -> a -> m ()
8383runFrameWithTriggerRef r a = do
8484 postGui <- askPostGui
8585 runWithActions <- askRunWithActions
86− liftIO . postGui $ mapM_ (\t -> runWithActions [t :=> a]) =<< readRef r
86+ liftIO . postGui $ mapM_ (\t -> runWithActions [t :=> Identity a]) =<< readRef r
8787
8888instance HasPostGui t h m => HasPostGui t h (ReaderT r m) where
8989 askPostGui = lift askPostGui
@@ -126,7 +126,7 @@ performEventAsync e = do
126126 addVoidAction $ ffor e $ \o -> do
127127 postGui <- askPostGui
128128 runWithActions <- askRunWithActions
129− o $ \a -> postGui $ mapM_ (\t -> runWithActions [t :=> a]) =<< readRef reResultTrigger
129+ o $ \a -> postGui $ mapM_ (\t -> runWithActions [t :=> Identity a]) =<< readRef reResultTrigger
130130 return eResult
131131
132132getPostBuild :: MonadWidget t m => m (Event t ())
src/Reflex/Dom/Internal.hs+1−1
@@ -33,7 +33,7 @@ import Data.Monoid ((<>))
3333data GuiEnv t h
3434 = GuiEnv { _guiEnvDocument :: !HTMLDocument
3535 , _guiEnvPostGui :: !(h () -> IO ())
36− , _guiEnvRunWithActions :: !([DSum (EventTrigger t)] -> h ())
36+ , _guiEnvRunWithActions :: !([DSum (EventTrigger t) Identity] -> h ())
3737 , _guiEnvWebView :: !WebView
3838 }
3939
src/Reflex/Dom/WebSocket.hs+2−2
@@ -44,10 +44,10 @@ webSocket url config = do
4444 let onMessage :: ByteString -> IO ()
4545 onMessage m = postGui $ do
4646 mt <- readRef eRecvTriggerRef
47− forM_ mt $ \t -> runWithActions [t :=> m]
47+ forM_ mt $ \t -> runWithActions [t :=> Identity m]
4848 onOpen = postGui $ do
4949 mt <- readRef eOpenTriggerRef
50− forM_ mt $ \t -> runWithActions [t :=> ()]
50+ forM_ mt $ \t -> runWithActions [t :=> Identity ()]
5151 start = do
5252 ws <- liftIO $ newWebSocket wv url onMessage onOpen $ do
5353 void $ forkIO $ do --TODO: Is the fork necessary, or do event handlers run in their own threads automatically?
src/Reflex/Dom/Widget/Basic.hs+2−2
@@ -353,7 +353,7 @@ wrapDomEventMaybe element elementOnevent getValue = do
353353 e <- newEventWithTrigger $ \et -> do
354354 unsubscribe <- {-# SCC "a" #-} liftIO $ {-# SCC "b" #-} elementOnevent element $ {-# SCC "c" #-} do
355355 mv <- {-# SCC "d" #-} getValue
356− forM_ mv $ \v -> liftIO $ postGui $ runWithActions [et :=> v]
356+ forM_ mv $ \v -> liftIO $ postGui $ runWithActions [et :=> Identity v]
357357 return $ liftIO $ do
358358 {-# SCC "e" #-} unsubscribe
359359 return $! {-# SCC "f" #-} e
@@ -606,7 +606,7 @@ wrapDomEventsMaybe element handlers = do
606606 e <- newFanEventWithTrigger $ \(WrapArg en) et -> do
607607 unsubscribe <- liftIO $ (onEventName en) element $ do
608608 mv <- handlers en
609− forM_ mv $ \v -> liftIO $ postGui $ runWithActions [et :=> v]
609+ forM_ mv $ \v -> liftIO $ postGui $ runWithActions [et :=> Identity v]
610610 return $ liftIO $ do
611611 unsubscribe
612612 return $! e
src/Reflex/Dom/Widget/Input.hs+4−4
@@ -60,9 +60,9 @@ textInput (TextInputConfig inputType initial eSetValue dAttrs) = do
6060 runWithActions <- askRunWithActions
6161 eChangeFocus <- newEventWithTrigger $ \eChangeFocusTrigger -> do
6262 unsubscribeOnblur <- liftIO $ elementOnblur e $ liftIO $ do
63− postGui $ runWithActions [eChangeFocusTrigger :=> False]
63+ postGui $ runWithActions [eChangeFocusTrigger :=> Identity False]
6464 unsubscribeOnfocus <- liftIO $ elementOnfocus e $ liftIO $ do
65− postGui $ runWithActions [eChangeFocusTrigger :=> True]
65+ postGui $ runWithActions [eChangeFocusTrigger :=> Identity True]
6666 return $ liftIO $ unsubscribeOnblur >> unsubscribeOnfocus
6767 dFocus <- holdDyn False eChangeFocus
6868 eKeypress <- wrapDomEvent e elementOnkeypress getKeyEvent
@@ -102,9 +102,9 @@ textArea (TextAreaConfig initial eSet attrs) = do
102102 runWithActions <- askRunWithActions
103103 eChangeFocus <- newEventWithTrigger $ \eChangeFocusTrigger -> do
104104 unsubscribeOnblur <- liftIO $ elementOnblur e $ liftIO $ do
105− postGui $ runWithActions [eChangeFocusTrigger :=> False]
105+ postGui $ runWithActions [eChangeFocusTrigger :=> Identity False]
106106 unsubscribeOnfocus <- liftIO $ elementOnfocus e $ liftIO $ do
107− postGui $ runWithActions [eChangeFocusTrigger :=> True]
107+ postGui $ runWithActions [eChangeFocusTrigger :=> Identity True]
108108 return $ liftIO $ unsubscribeOnblur >> unsubscribeOnfocus
109109 performEvent_ $ fmap (liftIO . htmlTextAreaElementSetValue e) eSet
110110 f <- holdDyn False eChangeFocus