on develop help sign in
Switch to automatic instance from DeriveFunctor
169e41fDoug Beardsley
src/Reflex/Dom/Xhr.hs+3−9
@@ -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
@@ -262,9 +262,3 @@ liftM concat $ mapM makeLenses
262 , ''XhrResponse
262 , ''XhrResponse
263 ]
263 ]
264
264
265−instance Functor XhrRequest where
266− fmap f = over xhrRequest_config (fmap f)
267−
268−instance Functor XhrRequestConfig where
269− fmap f = over xhrRequestConfig_sendData f
270−