From 5cf6a92c02982c829d108a2d06a02a7c541ca9ea Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Sun, 6 Dec 2009 00:46:59 +0200 Subject: [PATCH] convertible-text and attempt package split --- Data/Object/Instances.hs | 2 +- Data/Object/Translate.hs | 2 +- Web/Restful/Application.hs | 2 +- Web/Restful/Handler.hs | 3 ++- Web/Restful/Helpers/Auth.hs | 2 +- Web/Restful/Response.hs | 2 +- restful.cabal | 6 +++--- 7 files changed, 10 insertions(+), 9 deletions(-) diff --git a/Data/Object/Instances.hs b/Data/Object/Instances.hs index 609ce8d0..248e33fc 100644 --- a/Data/Object/Instances.hs +++ b/Data/Object/Instances.hs @@ -27,7 +27,7 @@ import Web.Encodings (encodeJson) import Text.Yaml (encodeText) import qualified Data.Text.Lazy as LT import Data.Text.Lazy (Text) -import Data.Convertible +import Data.Convertible.Text newtype Json = Json { unJson :: Text } instance ConvertAttempt (Object Text Text) Json where diff --git a/Data/Object/Translate.hs b/Data/Object/Translate.hs index 70af27dc..15bbda4c 100644 --- a/Data/Object/Translate.hs +++ b/Data/Object/Translate.hs @@ -31,7 +31,7 @@ module Data.Object.Translate import Data.Maybe (fromMaybe) import Data.Object -import Data.Attempt +import Control.Monad.Attempt import Data.Object.Text -- | Should usually be the well established I18N translation code. Examples diff --git a/Web/Restful/Application.hs b/Web/Restful/Application.hs index 98271329..211e1b09 100644 --- a/Web/Restful/Application.hs +++ b/Web/Restful/Application.hs @@ -43,7 +43,7 @@ import Web.Restful.Definitions import Web.Restful.Constants import Web.Restful.Resource -import Data.Convertible +import Data.Convertible.Text import Control.Arrow ((***)) -- | A data type that can be turned into a Hack application. diff --git a/Web/Restful/Handler.hs b/Web/Restful/Handler.hs index 63f1a4c7..e87ee849 100644 --- a/Web/Restful/Handler.hs +++ b/Web/Restful/Handler.hs @@ -54,11 +54,12 @@ type HandlerT m = type HandlerIO = HandlerT IO type Handler = HandlerIO [RepT HandlerIO] +-- FIXME shouldn't call error here... instance MonadRequestReader HandlerIO where askRawRequest = ask invalidParam _pt _pn _pe = error "invalidParam" authRequired = error "authRequired" -instance Exception e => MonadFailure e HandlerIO where +instance Exception e => Failure e HandlerIO where failure = error "HandlerIO failure" class ToHandler a where diff --git a/Web/Restful/Helpers/Auth.hs b/Web/Restful/Helpers/Auth.hs index dc372c76..b9c31a87 100644 --- a/Web/Restful/Helpers/Auth.hs +++ b/Web/Restful/Helpers/Auth.hs @@ -34,7 +34,7 @@ import Control.Monad.Reader import Control.Monad.Attempt import Data.Maybe (fromMaybe) -import Data.Attempt +import Control.Monad.Attempt data AuthResource = Check diff --git a/Web/Restful/Response.hs b/Web/Restful/Response.hs index ecbd3c02..a8b2a579 100644 --- a/Web/Restful/Response.hs +++ b/Web/Restful/Response.hs @@ -65,7 +65,7 @@ import Test.Framework (testGroup, Test) import Data.Generics import Control.Exception (Exception) import Data.Maybe (fromJust) -import Data.Convertible +import Data.Convertible.Text import Data.Text.Lazy (Text) diff --git a/restful.cabal b/restful.cabal index 17d71cc6..7314886a 100644 --- a/restful.cabal +++ b/restful.cabal @@ -25,7 +25,7 @@ library time >= 1.1.3 && < 1.2, hack >= 2009.5.19, split >= 0.1.1 && < 0.2, - authenticate >= 0.2.1 && < 0.3, + authenticate >= 0.4.0 && < 0.5, data-default >= 0.2 && < 0.3, predicates >= 0.1 && < 0.2, bytestring >= 0.9.1.4 && < 0.10, @@ -36,10 +36,10 @@ library directory >= 1 && < 1.1, transformers >= 0.1.4.0 && < 0.2, monads-fd >= 0.0.0.1 && < 0.1, - attempt >= 0.0.2 && < 0.1, + control-monad-attempt >= 0.0.0 && < 0.1, syb, text >= 0.5 && < 0.6, - convertible >= 1.2.0 && < 1.3, + convertible-text >= 0.0.0 && < 0.1, clientsession >= 0.0.1 && < 0.1, zlib >= 0.5.2.0 && < 0.6 exposed-modules: Web.Restful,