on develop help sign in
Merge branch 'ghcjs-improved-base-2' of github.com:ryantrinkle/reflex-dom into ghcjs-improved-base-2
commit639d9ca13c2def075e83344c9afca6eafaf24219 authorAli Abrar <aliabrar@gmail.com> dateMon 18 Jan 2016, 10:42 (11 years ago) parent5a6ad1a8c28c87
8 files changed+19−19
default.nix+1−1 reflex-dom.cabal+5−5 src/Reflex/Dom/Class.hs+3−3 src/Reflex/Dom/Internal.hs+1−1 src/Reflex/Dom/Time.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+5−5
@@ -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
@@ -22,10 +22,10 @@ library
2222 hs-source-dirs: src
2323 build-depends:
2424 base >= 4.7 && < 4.9,
25− reflex == 0.3.*,
26− dependent-sum == 0.2.*,
27− dependent-map == 0.1.*,
28− semigroups >= 0.16 && < 0.18,
25+ reflex == 0.4.*,
26+ dependent-sum == 0.3.*,
27+ dependent-map == 0.2.*,
28+ semigroups >= 0.16 && < 0.19,
2929 mtl >= 2.1 && < 2.3,
3030 containers == 0.5.*,
3131 these >= 0.4 && < 0.7,
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/Time.hs+1−1
@@ -63,7 +63,7 @@ delay dt e = performEventAsync $ ffor e $ \a cb -> liftIO $ void $ forkIO $ do
6363 threadDelay $ ceiling $ dt * 1000000
6464 cb a
6565
66−-- | Block occurrences of an Event until th given number of seconds elapses without
66+-- | Block occurrences of an Event until the given number of seconds elapses without
6767-- the Event firing, at which point the last occurrence of the Event will fire.
6868debounce :: MonadWidget t m => NominalDiffTime -> Event t a -> m (Event t a)
6969debounce dt e = do
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
@@ -608,7 +608,7 @@ wrapDomEventsMaybe element handlers = do
608608 e <- newFanEventWithTrigger $ \(WrapArg en) et -> do
609609 unsubscribe <- onEventName en element $ do
610610 mv <- handlers en
611− forM_ mv $ \v -> liftIO $ postGui $ runWithActions [et :=> v]
611+ forM_ mv $ \v -> liftIO $ postGui $ runWithActions [et :=> Identity v]
612612 return $ liftIO $ do
613613 unsubscribe
614614 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 <- on e blurEvent $ liftIO $ do
63− postGui $ runWithActions [eChangeFocusTrigger :=> False]
63+ postGui $ runWithActions [eChangeFocusTrigger :=> Identity False]
6464 unsubscribeOnfocus <- on e focusEvent $ 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 (`on` keyPress) getKeyEvent
@@ -102,9 +102,9 @@ textArea (TextAreaConfig initial eSet attrs) = do
102102 runWithActions <- askRunWithActions
103103 eChangeFocus <- newEventWithTrigger $ \eChangeFocusTrigger -> do
104104 unsubscribeOnblur <- on e blurEvent $ liftIO $ do
105− postGui $ runWithActions [eChangeFocusTrigger :=> False]
105+ postGui $ runWithActions [eChangeFocusTrigger :=> Identity False]
106106 unsubscribeOnfocus <- on e focusEvent $ liftIO $ do
107− postGui $ runWithActions [eChangeFocusTrigger :=> True]
107+ postGui $ runWithActions [eChangeFocusTrigger :=> Identity True]
108108 return $ liftIO $ unsubscribeOnblur >> unsubscribeOnfocus
109109 performEvent_ $ fmap (TextArea.setValue e . Just) eSet
110110 f <- holdDyn False eChangeFocus