fb 2.1.0 → 2.1.1
raw patch · 3 files changed
+33/−32 lines, 3 filesdep ~conduit-extradep ~monad-loggerdep ~resourcetPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: conduit-extra, monad-logger, resourcet, unliftio-core
API changes (from Hackage documentation)
Files
- README.md +1/−2
- fb.cabal +6/−6
- src/Facebook/Monad.hs +26/−24
README.md view
@@ -1,10 +1,9 @@ fb -- -[](https://travis-ci.org/psibi/fb)+[](https://dev.azure.com/psibi2000/Haskell%20Projects/_build/latest?definitionId=16&branchName=master) Haskell bindings to Facebook's API- ## Example code to get User Access token
fb.cabal view
@@ -4,10 +4,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: e2cc3ca3fd02a2be22dd0d92f12c223ee497832e69352eac893f894d5c690177+-- hash: fbc728728a747ce7668aa69d724cc5c3bba4c229c78cace64848a9542775f837 name: fb-version: 2.1.0+version: 2.1.1 synopsis: Bindings to Facebook's API. description: This package exports bindings to Facebook's APIs (see <http://developers.facebook.com/>). Does not have any external@@ -76,21 +76,21 @@ , base >=4 && <5 , bytestring >=0.9 , conduit >=1.3.0- , conduit-extra >=1.3.0+ , conduit-extra , cryptonite , data-default , http-client >=0.4.30 , http-conduit >=2.3.0 , http-types , memory- , monad-logger >=0.3.32- , resourcet >=1.2.3+ , monad-logger+ , resourcet , text >=0.11 , time >=1.4 , transformers >=0.2 , transformers-base , unliftio- , unliftio-core >=0.2.0+ , unliftio-core , unordered-containers if flag(debug) cpp-options: -DDEBUG
src/Facebook/Monad.hs view
@@ -1,5 +1,6 @@ {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE RankNTypes #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE MultiParamTypeClasses #-}@@ -60,23 +61,26 @@ -- Facebook. The phantom type @auth@ may be either 'Auth' (you -- have supplied your 'Credentials') or 'NoAuth' (you have not -- supplied any 'Credentials').-newtype FacebookT auth m a =- F- { unF :: ReaderT FbData m a -- FbData -> m a- }- deriving ( Functor- , Applicative- , Alternative- , Monad- , MonadFix- , MonadPlus- , MonadIO- , MonadTrans- , R.MonadThrow- , MonadFail- , MonadUnliftIO- )+newtype FacebookT auth m a = F+ { unF :: ReaderT FbData m a -- FbData -> m a+ } deriving ( Functor+ , Applicative+ , Alternative+ , Monad+ , MonadFix+ , MonadPlus+ , MonadIO+ , MonadTrans+ , R.MonadThrow+ , MonadFail+ ) +instance (MonadUnliftIO m) => MonadUnliftIO (FacebookT auth m) where+ withRunInIO inner =+ F $+ ReaderT $ \r ->+ withRunInIO $ \run -> inner (\fbT -> run $ (flip runReaderT) r (unF fbT))+ deriving instance (R.MonadResource m, MonadBase IO m) => R.MonadResource (FacebookT auth m)@@ -100,14 +104,12 @@ deriving (Typeable) -- | Internal data kept inside 'FacebookT'.-data FbData =- FbData- { fbdCreds :: Maybe Credentials- , fbdManager :: !H.Manager- , fbdTier :: !FbTier- , fbdApiVersion :: IORef ApiVersion- }- deriving (Typeable)+data FbData = FbData+ { fbdCreds :: Maybe Credentials+ , fbdManager :: !H.Manager+ , fbdTier :: !FbTier+ , fbdApiVersion :: IORef ApiVersion+ } deriving (Typeable) -- | Which Facebook tier should be used (see -- <https://developers.facebook.com/support/beta-tier/>).