on develop help sign in
Merge branch 'refactor' of github.com:reflex-frp/reflex-dom into refactor
a00be61Ryan Trinkle
src/Reflex/Dom/Widget/Resize.hs+5−3
@@ -4,12 +4,14 @@ module Reflex.Dom.Widget.Resize where
4import Reflex
4import Reflex
5import Reflex.Dom.PostBuild.Class
5import Reflex.Dom.PostBuild.Class
6import Reflex.Dom.PerformEvent.Class
6import Reflex.Dom.PerformEvent.Class
7+import Reflex.Dom.Builder.Class
7import Reflex.Dom.Builder.Immediate
8import Reflex.Dom.Builder.Immediate
8import Reflex.Dom.Class
9import Reflex.Dom.Class
9import Reflex.Dom.Old
10import Reflex.Dom.Old
10import Reflex.Dom.Widget.Basic
11import Reflex.Dom.Widget.Basic
11
12
12import Control.Monad
13import Control.Monad
14+import Control.Monad.Fix
13import Control.Monad.IO.Class
15import Control.Monad.IO.Class
14import Data.Map (Map)
16import Data.Map (Map)
15import Data.Text (Text)
17import Data.Text (Text)
@@ -21,16 +23,16 @@ import qualified Data.Map as Map
21
23
22-- | A widget that wraps the given widget in a div and fires an event when resized.
24-- | A widget that wraps the given widget in a div and fires an event when resized.
23-- Adapted from github.com/marcj/css-element-queries
25-- Adapted from github.com/marcj/css-element-queries
24−resizeDetector :: MonadWidget t m => m a -> m (Event t (), a)
26+resizeDetector :: (DomBuilder t m, PostBuild t m, TriggerEvent t m, PerformEvent t m, MonadHold t m, DomBuilderSpace m ~ GhcjsDomSpace, MonadIO (Performable m), MonadIO m, MonadFix m) => m a -> m (Event t (), a)
25resizeDetector = resizeDetectorWithStyle ""
27resizeDetector = resizeDetectorWithStyle ""
26
28
27−resizeDetectorWithStyle :: MonadWidget t m
29+resizeDetectorWithStyle :: (DomBuilder t m, PostBuild t m, TriggerEvent t m, PerformEvent t m, MonadHold t m, DomBuilderSpace m ~ GhcjsDomSpace, MonadIO (Performable m), MonadIO m, MonadFix m)
28 => Text -- ^ A css style string. Warning: It should not contain the "position" style attribute.
30 => Text -- ^ A css style string. Warning: It should not contain the "position" style attribute.
29 -> m a -- ^ The embedded widget
31 -> m a -- ^ The embedded widget
30 -> m (Event t (), a) -- ^ An 'Event' that fires on resize, and the result of the embedded widget
32 -> m (Event t (), a) -- ^ An 'Event' that fires on resize, and the result of the embedded widget
31resizeDetectorWithStyle styleString w = resizeDetectorWithAttrs ("style" =: styleString) w
33resizeDetectorWithStyle styleString w = resizeDetectorWithAttrs ("style" =: styleString) w
32
34
33−resizeDetectorWithAttrs :: MonadWidget t m
35+resizeDetectorWithAttrs :: (DomBuilder t m, PostBuild t m, TriggerEvent t m, PerformEvent t m, MonadHold t m, DomBuilderSpace m ~ GhcjsDomSpace, MonadIO (Performable m), MonadIO m, MonadFix m)
34 => Map Text Text -- ^ A map of attributes. Warning: It should not modify the "position" style attribute.
36 => Map Text Text -- ^ A map of attributes. Warning: It should not modify the "position" style attribute.
35 -> m a -- ^ The embedded widget
37 -> m a -- ^ The embedded widget
36 -> m (Event t (), a) -- ^ An 'Event' that fires on resize, and the result of the embedded widget
38 -> m (Event t (), a) -- ^ An 'Event' that fires on resize, and the result of the embedded widget
src/Reflex/Dom/Xhr.hs+4−3
@@ -1,4 +1,4 @@
1−{-# LANGUAGE TemplateHaskell, GADTs, DeriveDataTypeable, FlexibleContexts, OverloadedStrings #-}
1+{-# LANGUAGE TemplateHaskell, GADTs, DeriveDataTypeable, DeriveFunctor, FlexibleContexts, OverloadedStrings #-}
2module Reflex.Dom.Xhr
2module Reflex.Dom.Xhr
3 ( XMLHttpRequest
3 ( XMLHttpRequest
4 , XhrRequest(..)
4 , XhrRequest(..)
@@ -80,7 +80,7 @@ data XhrRequest a
80 , _xhrRequest_url :: Text
80 , _xhrRequest_url :: Text
81 , _xhrRequest_config :: XhrRequestConfig a
81 , _xhrRequest_config :: XhrRequestConfig a
82 }
82 }
83− deriving (Show, Read, Eq, Ord, Typeable)
83+ deriving (Show, Read, Eq, Ord, Typeable, Functor)
84
84
85data XhrRequestConfig a
85data XhrRequestConfig a
86 = XhrRequestConfig { _xhrRequestConfig_headers :: Map Text Text
86 = XhrRequestConfig { _xhrRequestConfig_headers :: Map Text Text
@@ -89,7 +89,7 @@ data XhrRequestConfig a
89 , _xhrRequestConfig_responseType :: Maybe XhrResponseType
89 , _xhrRequestConfig_responseType :: Maybe XhrResponseType
90 , _xhrRequestConfig_sendData :: a
90 , _xhrRequestConfig_sendData :: a
91 }
91 }
92− deriving (Show, Read, Eq, Ord, Typeable)
92+ deriving (Show, Read, Eq, Ord, Typeable, Functor)
93
93
94data XhrResponse
94data XhrResponse
95 = XhrResponse { _xhrResponse_status :: Word
95 = XhrResponse { _xhrResponse_status :: Word
@@ -261,3 +261,4 @@ liftM concat $ mapM makeLenses
261 , ''XhrRequestConfig
261 , ''XhrRequestConfig
262 , ''XhrResponse
262 , ''XhrResponse
263 ]
263 ]
264+