From a948639673ffbb0a1c90f9331ec597e8230d0de3 Mon Sep 17 00:00:00 2001 From: Amar Date: Thu, 21 Apr 2016 19:31:51 +0800 Subject: [PATCH 1/6] 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 ee27846cc..6ea8bef72 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 e7012fddc..2c3fd1ea5 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 bbba7c1b0..257a721d1 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 821d56409..2f01609a4 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 55cf4c178..3c35a5da3 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 f1c88b2e0..35168dc20 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) From 4045d20c8d218ac5ab2f74780b3a1b9714aece64 Mon Sep 17 00:00:00 2001 From: Amar Date: Thu, 21 Apr 2016 20:30:11 +0800 Subject: [PATCH 2/6] Fix unused warning --- servant-client/src/Servant/Client.hs | 1 - 1 file changed, 1 deletion(-) diff --git a/servant-client/src/Servant/Client.hs b/servant-client/src/Servant/Client.hs index 6ea8bef72..ee27846cc 100644 --- a/servant-client/src/Servant/Client.hs +++ b/servant-client/src/Servant/Client.hs @@ -43,7 +43,6 @@ 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 From 3f4bcf7752bd87a24bc03305e95726a2c5833ad5 Mon Sep 17 00:00:00 2001 From: Amar Date: Thu, 28 Apr 2016 22:11:40 +0800 Subject: [PATCH 3/6] Remove mmorph dependency from servant-server --- servant-server/servant-server.cabal | 1 - 1 file changed, 1 deletion(-) diff --git a/servant-server/servant-server.cabal b/servant-server/servant-server.cabal index 2c3fd1ea5..f9c64b252 100644 --- a/servant-server/servant-server.cabal +++ b/servant-server/servant-server.cabal @@ -56,7 +56,6 @@ library , http-types >= 0.8 && < 0.10 , network-uri >= 2.6 && < 2.7 , mtl >= 2 && < 3 - , mmorph >= 1 , network >= 2.6 && < 2.7 , safe >= 0.3 && < 0.4 , servant == 0.7.* From 61a99c9567fba95319a3be9d390ab04978e10e1e Mon Sep 17 00:00:00 2001 From: Amar Date: Thu, 28 Apr 2016 22:26:27 +0800 Subject: [PATCH 4/6] Replace Servant.Server.Internal.Enter with Servant.Utils.Enter in a comment --- servant-server/src/Servant/Server/Internal/Context.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/servant-server/src/Servant/Server/Internal/Context.hs b/servant-server/src/Servant/Server/Internal/Context.hs index 580a75420..cf84689b4 100644 --- a/servant-server/src/Servant/Server/Internal/Context.hs +++ b/servant-server/src/Servant/Server/Internal/Context.hs @@ -18,7 +18,7 @@ import GHC.TypeLits -- | 'Context's are used to pass values to combinators. (They are __not__ meant -- to be used to pass parameters to your handlers, i.e. they should not replace -- any custom 'Control.Monad.Trans.Reader.ReaderT'-monad-stack that you're using --- with 'Servant.Server.Internal.Enter.enter'.) If you don't use combinators that +-- with 'Servant.Utils.Enter'.) If you don't use combinators that -- require any context entries, you can just use 'Servant.Server.serve' as always. -- -- If you are using combinators that require a non-empty 'Context' you have to From 845a06ccbd4c7b594b242fc8a37d64bed11d2a11 Mon Sep 17 00:00:00 2001 From: Amar Date: Thu, 28 Apr 2016 22:27:50 +0800 Subject: [PATCH 5/6] Correct the description of arbitrary monad server spec --- servant-server/test/Servant/ArbitraryMonadServerSpec.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/servant-server/test/Servant/ArbitraryMonadServerSpec.hs b/servant-server/test/Servant/ArbitraryMonadServerSpec.hs index 2f01609a4..444d86ecf 100644 --- a/servant-server/test/Servant/ArbitraryMonadServerSpec.hs +++ b/servant-server/test/Servant/ArbitraryMonadServerSpec.hs @@ -14,7 +14,7 @@ import Test.Hspec.Wai (get, matchStatus, post, shouldRespondWith, with) spec :: Spec -spec = describe "module Servant.Server.Enter" $ do +spec = describe "Arbitrary monad server" $ do enterSpec type ReaderAPI = "int" :> Get '[JSON] Int From e9cbb85ce12fb8334d4a66fb4a539eda1c48ce7a Mon Sep 17 00:00:00 2001 From: Amar Date: Tue, 10 May 2016 22:16:37 +0800 Subject: [PATCH 6/6] Add changelog entries --- servant-server/CHANGELOG.md | 5 +++++ servant/CHANGELOG.md | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/servant-server/CHANGELOG.md b/servant-server/CHANGELOG.md index b4213b6dd..e1ed25be4 100644 --- a/servant-server/CHANGELOG.md +++ b/servant-server/CHANGELOG.md @@ -1,3 +1,8 @@ +0.7.1 +------ + +* Remove module `Servant.Server.Internal.Enter` (https://github.com/haskell-servant/servant/pull/478) + 0.7 --- diff --git a/servant/CHANGELOG.md b/servant/CHANGELOG.md index efeecf661..c9762c791 100644 --- a/servant/CHANGELOG.md +++ b/servant/CHANGELOG.md @@ -1,3 +1,8 @@ +0.7.1 +------ + +* Add module `Servant.Utils.Enter` (https://github.com/haskell-servant/servant/pull/478) + 0.5 ----