Skip to content

Commit

Permalink
Move Servant.Utils.Links -> Servant.Links. Fixes #997.
Browse files Browse the repository at this point in the history
  • Loading branch information
phadej committed Jun 25, 2018
1 parent 5854071 commit 2c02287
Show file tree
Hide file tree
Showing 8 changed files with 507 additions and 497 deletions.
4 changes: 2 additions & 2 deletions servant-server/src/Servant.hs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module Servant (
-- | For implementing servers for servant APIs.
module Servant.Server,
-- | Utilities on top of the servant core
module Servant.Utils.Links,
module Servant.Links,
module Servant.Utils.StaticFiles,
-- | Useful re-exports
Proxy(..),
Expand All @@ -17,5 +17,5 @@ import Control.Monad.Error.Class (throwError)
import Data.Proxy
import Servant.API
import Servant.Server
import Servant.Utils.Links
import Servant.Links
import Servant.Utils.StaticFiles
2 changes: 1 addition & 1 deletion servant-server/src/Servant/Server/Internal/Context.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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.Utils.Enter'.) If you don't use combinators that
-- with 'hoistServer'.) 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
Expand Down
8 changes: 6 additions & 2 deletions servant/servant.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ library
Servant.API.Vault
Servant.API.Verbs
Servant.API.WithNamedContext
Servant.Links

-- Deprecated modules, to be removed in late 2019
exposed-modules:
Servant.Utils.Links

-- Bundled with GHC: Lower bound to not force re-installs
Expand Down Expand Up @@ -131,7 +135,7 @@ test-suite spec
other-modules:
Servant.API.ContentTypesSpec
Servant.API.ResponseHeadersSpec
Servant.Utils.LinksSpec
Servant.LinksSpec

-- Dependencies inherited from the library. No need to specify bounds.
build-depends:
Expand Down Expand Up @@ -176,4 +180,4 @@ test-suite doctests
x-doctest-options: -fdiagnostics-color=never
include-dirs: include
x-doctest-source-dirs: test
x-doctest-modules: Servant.Utils.LinksSpec
x-doctest-modules: Servant.LinksSpec
6 changes: 3 additions & 3 deletions servant/src/Servant/API.hs
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ module Servant.API (
module Servant.API.Experimental.Auth,
-- | General Authentication

-- * Utilities
module Servant.Utils.Links,
-- * Links
module Servant.Links,
-- | Type-safe internal URIs

-- * Re-exports
Expand Down Expand Up @@ -134,7 +134,7 @@ import Servant.API.Verbs
ReflectMethod (reflectMethod), StdMethod (..), Verb)
import Servant.API.WithNamedContext
(WithNamedContext)
import Servant.Utils.Links
import Servant.Links
(HasLink (..), IsElem, IsElem', Link, URI (..), safeLink)
import Web.HttpApiData
(FromHttpApiData (..), ToHttpApiData (..))
2 changes: 1 addition & 1 deletion servant/src/Servant/API/Verbs.hs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ type Patch = Verb 'PATCH 200
--
-- If the resource cannot be created immediately, use 'PostAccepted'.
--
-- Consider using 'Servant.Utils.Links.safeLink' for the @Location@ header
-- Consider using 'Servant.Links.safeLink' for the @Location@ header
-- field.

-- | 'POST' with 201 status code.
Expand Down
Loading

0 comments on commit 2c02287

Please sign in to comment.