Skip to content

Commit e3c91ec

Browse files
authored
Merge pull request #998 from phadej/issue-997
Move Servant.Utils.Links -> Servant.Links. Fixes #997.
2 parents 5854071 + 2c02287 commit e3c91ec

File tree

8 files changed

+507
-497
lines changed

8 files changed

+507
-497
lines changed

servant-server/src/Servant.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ module Servant (
66
-- | For implementing servers for servant APIs.
77
module Servant.Server,
88
-- | Utilities on top of the servant core
9-
module Servant.Utils.Links,
9+
module Servant.Links,
1010
module Servant.Utils.StaticFiles,
1111
-- | Useful re-exports
1212
Proxy(..),
@@ -17,5 +17,5 @@ import Control.Monad.Error.Class (throwError)
1717
import Data.Proxy
1818
import Servant.API
1919
import Servant.Server
20-
import Servant.Utils.Links
20+
import Servant.Links
2121
import Servant.Utils.StaticFiles

servant-server/src/Servant/Server/Internal/Context.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import GHC.TypeLits
1818
-- | 'Context's are used to pass values to combinators. (They are __not__ meant
1919
-- to be used to pass parameters to your handlers, i.e. they should not replace
2020
-- any custom 'Control.Monad.Trans.Reader.ReaderT'-monad-stack that you're using
21-
-- with 'Servant.Utils.Enter'.) If you don't use combinators that
21+
-- with 'hoistServer'.) If you don't use combinators that
2222
-- require any context entries, you can just use 'Servant.Server.serve' as always.
2323
--
2424
-- If you are using combinators that require a non-empty 'Context' you have to

servant/servant.cabal

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ library
6262
Servant.API.Vault
6363
Servant.API.Verbs
6464
Servant.API.WithNamedContext
65+
Servant.Links
66+
67+
-- Deprecated modules, to be removed in late 2019
68+
exposed-modules:
6569
Servant.Utils.Links
6670

6771
-- Bundled with GHC: Lower bound to not force re-installs
@@ -131,7 +135,7 @@ test-suite spec
131135
other-modules:
132136
Servant.API.ContentTypesSpec
133137
Servant.API.ResponseHeadersSpec
134-
Servant.Utils.LinksSpec
138+
Servant.LinksSpec
135139

136140
-- Dependencies inherited from the library. No need to specify bounds.
137141
build-depends:
@@ -176,4 +180,4 @@ test-suite doctests
176180
x-doctest-options: -fdiagnostics-color=never
177181
include-dirs: include
178182
x-doctest-source-dirs: test
179-
x-doctest-modules: Servant.Utils.LinksSpec
183+
x-doctest-modules: Servant.LinksSpec

servant/src/Servant/API.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ module Servant.API (
6363
module Servant.API.Experimental.Auth,
6464
-- | General Authentication
6565

66-
-- * Utilities
67-
module Servant.Utils.Links,
66+
-- * Links
67+
module Servant.Links,
6868
-- | Type-safe internal URIs
6969

7070
-- * Re-exports
@@ -134,7 +134,7 @@ import Servant.API.Verbs
134134
ReflectMethod (reflectMethod), StdMethod (..), Verb)
135135
import Servant.API.WithNamedContext
136136
(WithNamedContext)
137-
import Servant.Utils.Links
137+
import Servant.Links
138138
(HasLink (..), IsElem, IsElem', Link, URI (..), safeLink)
139139
import Web.HttpApiData
140140
(FromHttpApiData (..), ToHttpApiData (..))

servant/src/Servant/API/Verbs.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ type Patch = Verb 'PATCH 200
5858
--
5959
-- If the resource cannot be created immediately, use 'PostAccepted'.
6060
--
61-
-- Consider using 'Servant.Utils.Links.safeLink' for the @Location@ header
61+
-- Consider using 'Servant.Links.safeLink' for the @Location@ header
6262
-- field.
6363

6464
-- | 'POST' with 201 status code.

0 commit comments

Comments
 (0)