From 4590d4afad2cafc2dd5056121aaab0d4249dcbf8 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Sun, 25 Apr 2010 11:12:56 -0700 Subject: [PATCH] Add back transformers 0.1 support --- Web/Authenticate/OpenId.hs | 7 ++++++- Web/Authenticate/Rpxnow.hs | 5 +++++ authenticate.cabal | 11 +++++++++-- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/Web/Authenticate/OpenId.hs b/Web/Authenticate/OpenId.hs index d5409f34..7e66ac7c 100644 --- a/Web/Authenticate/OpenId.hs +++ b/Web/Authenticate/OpenId.hs @@ -1,6 +1,7 @@ {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE FlexibleContexts #-} +{-# LANGUAGE CPP #-} --------------------------------------------------------- -- | -- Module : Web.Authenticate.OpenId @@ -23,8 +24,12 @@ module Web.Authenticate.OpenId import Network.HTTP.Wget import Text.HTML.TagSoup import Numeric (showHex) -import Control.Monad.IO.Class import qualified Safe.Failure as A +#if TRANSFORMERS_02 +import Control.Monad.IO.Class +#else +import Control.Monad.Trans +#endif import Data.Generics import Control.Failure hiding (Error) import Control.Exception diff --git a/Web/Authenticate/Rpxnow.hs b/Web/Authenticate/Rpxnow.hs index f73d5071..e015329b 100644 --- a/Web/Authenticate/Rpxnow.hs +++ b/Web/Authenticate/Rpxnow.hs @@ -1,4 +1,5 @@ {-# LANGUAGE FlexibleContexts #-} +{-# LANGUAGE CPP #-} --------------------------------------------------------- -- -- Module : Web.Authenticate.Rpxnow @@ -20,7 +21,11 @@ module Web.Authenticate.Rpxnow import Text.JSON -- FIXME use Data.Object.JSON import Network.HTTP.Wget import Data.Maybe (isJust, fromJust) +#if TRANSFORMERS_02 import Control.Monad.IO.Class +#else +import Control.Monad.Trans +#endif import Control.Failure -- | Information received from Rpxnow after a valid login. diff --git a/authenticate.cabal b/authenticate.cabal index cd94350a..11c698d6 100644 --- a/authenticate.cabal +++ b/authenticate.cabal @@ -1,5 +1,5 @@ name: authenticate -version: 0.6.0 +version: 0.6.0.1 license: BSD3 license-file: LICENSE author: Michael Snoyman @@ -13,6 +13,9 @@ cabal-version: >= 1.2 build-type: Simple homepage: http://github.com/snoyberg/authenticate/tree/master +flag transformers_02 + description: transformers = 0.2.* + library build-depends: base >= 4 && < 5, json >= 0.4.3 && < 0.5, @@ -20,8 +23,12 @@ library tagsoup >= 0.6 && < 0.9, failure >= 0.0.0 && < 0.1, safe-failure >= 0.4 && < 0.5, - transformers >= 0.2 && < 0.3, syb + if flag(transformers_02) + build-depends: transformers >= 0.2 && < 0.3 + CPP-OPTIONS: -DTRANSFORMERS_02 + else + build-depends: transformers >= 0.1 && < 0.2 exposed-modules: Web.Authenticate.Rpxnow, Web.Authenticate.OpenId ghc-options: -Wall -fno-warn-orphans