@@ -28,6 +28,9 @@
28-- application stack.
28-- application stack.
29module Network.Google
29module Network.Google
31 -- * Running Google Actions
34 -- * Running Google Actions
32 Google (..)
35 Google (..)
33 , MonadGoogle (..)
36 , MonadGoogle (..)
@@ -44,12 +47,14 @@ module Network.Google
44 , getApplicationDefault
47 , getApplicationDefault
46 -- ** Authorization
49 -- ** Authorization
51 , type HasScope
57 , type HasScope
54 -- * Sending Requests
59 -- * Sending Requests
@@ -152,17 +157,17 @@ runGoogle :: (MonadResource m, HasEnv s r) => r -> Google s a -> m a
152runGoogle e m = liftResourceT $ runReaderT (unGoogle m) (e ^. environment)
157runGoogle e m = liftResourceT $ runReaderT (unGoogle m) (e ^. environment)
154-- | Monads in which 'Google' actions may be embedded.
159-- | Monads in which 'Google' actions may be embedded.
156− , Functor m
160+class ( Functor m
157 , Applicative m
161 , Applicative m
158 , Monad m
162 , Monad m
159 , MonadIO m
163 , MonadIO m
160 , MonadCatch m
164 , MonadCatch m
161 ) => MonadGoogle s m | m -> s where
166 ) => MonadGoogle s m | m -> s where
162 -- | Lift a computation to the 'Google' monad.
167 -- | Lift a computation to the 'Google' monad.
163 liftGoogle :: Google s a -> m a
168 liftGoogle :: Google s a -> m a
165−instance Allow s => MonadGoogle s (Google s) where
170+instance AllowScopes s => MonadGoogle s (Google s) where
166 liftGoogle = id
171 liftGoogle = id
168instance MonadBaseControl IO (Google s) where
173instance MonadBaseControl IO (Google s) where
@@ -243,6 +248,14 @@ upload x = send . MediaUpload x
243hoistError :: MonadThrow m => Either Error a -> m a
248hoistError :: MonadThrow m => Either Error a -> m a
244hoistError = either (throwingM _Error) return
249hoistError = either (throwingM _Error) return
252+Usage explanation and example placeholder.
256+Authorization explanation and example placeholder.
247Requests can be sent asynchronously, but due to guarantees about resource closure
260Requests can be sent asynchronously, but due to guarantees about resource closure
248require the use of <http://hackage.haskell.org/package/lifted-async lifted-async>.
261require the use of <http://hackage.haskell.org/package/lifted-async lifted-async>.