ig 0.2.1 → 0.2.2
raw patch · 2 files changed
+18/−4 lines, 2 filesdep −attoparsecdep ~conduitdep ~transformers
Dependencies removed: attoparsec
Dependency ranges changed: conduit, transformers
Files
- ig.cabal +3/−4
- src/Instagram/Monad.hs +15/−0
ig.cabal view
@@ -1,5 +1,5 @@ name: ig-version: 0.2.1+version: 0.2.2 synopsis: Bindings to Instagram's API. homepage: https://github.com/prowdsponsor/ig license: BSD3@@ -44,13 +44,12 @@ base >= 4 && < 5 , bytestring >= 0.9 && < 0.11 , text >= 0.11- , transformers >= 0.2 && < 0.4+ , transformers >= 0.2 && < 0.5 , transformers-base , monad-control , resourcet , http-types , http-conduit >= 2.0 && < 2.2- , attoparsec >= 0.10 && < 0.12 , aeson >= 0.5 , time , data-default@@ -62,7 +61,7 @@ , base16-bytestring >= 0.1 if flag(conduit11) build-depends:- conduit == 1.1.*+ conduit >= 1.1.0.0 && < 1.3 , conduit-extra == 1.1.* else build-depends:
src/Instagram/Monad.hs view
@@ -41,6 +41,9 @@ import Control.Monad.Trans.Class (MonadTrans(lift)) import Control.Monad.Trans.Control ( MonadTransControl(..), MonadBaseControl(..) , ComposeSt, defaultLiftBaseWith+#if MIN_VERSION_monad_control(1,0,0)+ , defaultLiftWith, defaultRestoreT+#endif , defaultRestoreM ) import Control.Monad.Trans.Reader (ReaderT(..), ask, mapReaderT) import Data.Default (def)@@ -79,7 +82,18 @@ instance MonadBase b m => MonadBase b (InstagramT m) where liftBase = lift . liftBase +#if MIN_VERSION_monad_control(1,0,0) instance MonadTransControl InstagramT where+ type StT InstagramT a = StT (ReaderT IsData) a+ liftWith = defaultLiftWith Is unIs+ restoreT = defaultRestoreT Is++instance MonadBaseControl b m => MonadBaseControl b (InstagramT m) where+ type StM (InstagramT m) a = ComposeSt InstagramT m a+ liftBaseWith = defaultLiftBaseWith+ restoreM = defaultRestoreM+#else+instance MonadTransControl InstagramT where newtype StT InstagramT a = FbStT { unFbStT :: StT (ReaderT IsData) a } liftWith f = Is $ liftWith (\run -> f (liftM FbStT . run . unIs)) restoreT = Is . restoreT . liftM unFbStT@@ -88,6 +102,7 @@ newtype StM (InstagramT m) a = StMT {unStMT :: ComposeSt InstagramT m a} liftBaseWith = defaultLiftBaseWith StMT restoreM = defaultRestoreM unStMT+#endif -- | Run a computation in the 'InstagramT' monad transformer with -- your credentials.