From a948639673ffbb0a1c90f9331ec597e8230d0de3 Mon Sep 17 00:00:00 2001 From: Amar Date: Thu, 21 Apr 2016 19:31:51 +0800 Subject: [PATCH] Move enter to servant package --- servant-client/src/Servant/Client.hs | 1 + servant-server/servant-server.cabal | 2 -- servant-server/src/Servant/Server.hs | 2 +- .../Internal/EnterSpec.hs => ArbitraryMonadServerSpec.hs} | 2 +- servant/servant.cabal | 3 +++ .../Server/Internal => servant/src/Servant/Utils}/Enter.hs | 2 +- 6 files changed, 7 insertions(+), 5 deletions(-) rename servant-server/test/Servant/{Server/Internal/EnterSpec.hs => ArbitraryMonadServerSpec.hs} (97%) rename {servant-server/src/Servant/Server/Internal => servant/src/Servant/Utils}/Enter.hs (98%) diff --git a/servant-client/src/Servant/Client.hs b/servant-client/src/Servant/Client.hs index ee27846c..6ea8bef7 100644 --- a/servant-client/src/Servant/Client.hs +++ b/servant-client/src/Servant/Client.hs @@ -43,6 +43,7 @@ import Servant.Client.Experimental.Auth import Servant.Common.BaseUrl import Servant.Common.BasicAuth import Servant.Common.Req +import Servant.Utils.Enter -- * Accessing APIs as a Client diff --git a/servant-server/servant-server.cabal b/servant-server/servant-server.cabal index e7012fdd..2c3fd1ea 100644 --- a/servant-server/servant-server.cabal +++ b/servant-server/servant-server.cabal @@ -40,7 +40,6 @@ library Servant.Server.Internal Servant.Server.Internal.BasicAuth Servant.Server.Internal.Context - Servant.Server.Internal.Enter Servant.Server.Internal.Router Servant.Server.Internal.RoutingApplication Servant.Server.Internal.ServantErr @@ -101,7 +100,6 @@ test-suite spec other-modules: Servant.Server.ErrorSpec Servant.Server.Internal.ContextSpec - Servant.Server.Internal.EnterSpec Servant.ServerSpec Servant.Server.UsingContextSpec Servant.Server.UsingContextSpec.TestCombinators diff --git a/servant-server/src/Servant/Server.hs b/servant-server/src/Servant/Server.hs index bbba7c1b..257a721d 100644 --- a/servant-server/src/Servant/Server.hs +++ b/servant-server/src/Servant/Server.hs @@ -101,7 +101,7 @@ import Data.Proxy (Proxy) import Data.Text (Text) import Network.Wai (Application) import Servant.Server.Internal -import Servant.Server.Internal.Enter +import Servant.Utils.Enter -- * Implementing Servers diff --git a/servant-server/test/Servant/Server/Internal/EnterSpec.hs b/servant-server/test/Servant/ArbitraryMonadServerSpec.hs similarity index 97% rename from servant-server/test/Servant/Server/Internal/EnterSpec.hs rename to servant-server/test/Servant/ArbitraryMonadServerSpec.hs index 821d5640..2f01609a 100644 --- a/servant-server/test/Servant/Server/Internal/EnterSpec.hs +++ b/servant-server/test/Servant/ArbitraryMonadServerSpec.hs @@ -1,7 +1,7 @@ {-# LANGUAGE DataKinds #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TypeOperators #-} -module Servant.Server.Internal.EnterSpec where +module Servant.ArbitraryMonadServerSpec where import qualified Control.Category as C import Control.Monad.Reader diff --git a/servant/servant.cabal b/servant/servant.cabal index 55cf4c17..3c35a5da 100644 --- a/servant/servant.cabal +++ b/servant/servant.cabal @@ -47,6 +47,7 @@ library Servant.API.Verbs Servant.API.WithNamedContext Servant.Utils.Links + Servant.Utils.Enter build-depends: base >= 4.7 && < 4.9 , base-compat >= 0.9 @@ -58,6 +59,8 @@ library , http-api-data >= 0.1 && < 0.3 , http-media >= 0.4 && < 0.7 , http-types >= 0.8 && < 0.10 + , mtl >= 2 && < 3 + , mmorph >= 1 , text >= 1 && < 2 , string-conversions >= 0.3 && < 0.5 , network-uri >= 2.6 diff --git a/servant-server/src/Servant/Server/Internal/Enter.hs b/servant/src/Servant/Utils/Enter.hs similarity index 98% rename from servant-server/src/Servant/Server/Internal/Enter.hs rename to servant/src/Servant/Utils/Enter.hs index f1c88b2e..35168dc2 100644 --- a/servant-server/src/Servant/Server/Internal/Enter.hs +++ b/servant/src/Servant/Utils/Enter.hs @@ -8,7 +8,7 @@ {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} -module Servant.Server.Internal.Enter where +module Servant.Utils.Enter where import qualified Control.Category as C #if MIN_VERSION_mtl(2,2,1)