on master help sign in
Rename ApiQuasiQuoting.
dee4765Julian K. Arni
servant.cabal+1−1
@@ -31,8 +31,8 @@ library
31 Servant.Common.Req
31 Servant.Common.Req
32 Servant.Common.Text
32 Servant.Common.Text
33 Servant.Docs
33 Servant.Docs
34+ Servant.QQ
34 Servant.Server
35 Servant.Server
35− Servant.Utils.ApiQuasiQuoting
36 Servant.Utils.Links
36 Servant.Utils.Links
37 Servant.Utils.StaticFiles
37 Servant.Utils.StaticFiles
38 build-depends:
38 build-depends:
src/Servant.hs+2−2
@@ -12,7 +12,7 @@ module Servant (
12 -- | Using your types in request paths and query string parameters
12 -- | Using your types in request paths and query string parameters
13 module Servant.Common.Text,
13 module Servant.Common.Text,
14 -- | Utilities on top of the servant core
14 -- | Utilities on top of the servant core
15− module Servant.Utils.ApiQuasiQuoting,
15+ module Servant.QQ,
16 module Servant.Utils.Links,
16 module Servant.Utils.Links,
17 module Servant.Utils.StaticFiles,
17 module Servant.Utils.StaticFiles,
18 -- | Useful re-exports
18 -- | Useful re-exports
@@ -25,6 +25,6 @@ import Servant.Client
25import Servant.Common.Text
25import Servant.Common.Text
26import Servant.Docs
26import Servant.Docs
27import Servant.Server
27import Servant.Server
28−import Servant.Utils.ApiQuasiQuoting
28+import Servant.QQ
29import Servant.Utils.Links
29import Servant.Utils.Links
30import Servant.Utils.StaticFiles
30import Servant.Utils.StaticFiles
src/Servant/API.hs+2−2
@@ -31,7 +31,7 @@ module Servant.API (
31
31
32 -- * Utilities
32 -- * Utilities
33 -- | QuasiQuotes for endpoints
33 -- | QuasiQuotes for endpoints
34− module Servant.Utils.ApiQuasiQuoting,
34+ module Servant.QQ,
35 -- | Type-safe internal URLs
35 -- | Type-safe internal URLs
36 module Servant.Utils.Links,
36 module Servant.Utils.Links,
37 ) where
37 ) where
@@ -46,6 +46,6 @@ import Servant.API.QueryParam
46import Servant.API.Raw
46import Servant.API.Raw
47import Servant.API.ReqBody
47import Servant.API.ReqBody
48import Servant.API.Sub
48import Servant.API.Sub
49−import Servant.Utils.ApiQuasiQuoting (sitemap)
49+import Servant.QQ (sitemap)
50import Servant.Utils.Links (mkLink)
50import Servant.Utils.Links (mkLink)
51import Servant.Utils.StaticFiles
51import Servant.Utils.StaticFiles
src/Servant/Utils/ApiQuasiQuoting.hs → src/Servant/QQ.hsrenamed+4−8
@@ -21,12 +21,12 @@
21--
21--
22-- @
22-- @
23-- "hello" :> ReqBody String :> Put ()
23-- "hello" :> ReqBody String :> Put ()
24−-- :<|> "hello" :> Capture "p" Int :> ReqBody String :> Post ()
24+-- :\<|> "hello" :> Capture "p" Int :> ReqBody String :> Post ()
25−-- :<|> "hello" :> QueryParam "name" String :> Get Int
25+-- :\<|> "hello" :> QueryParam "name" String :> Get Int
26-- @
26-- @
27--
27--
28−-- Note the '/' before a 'QueryParam'!
28+-- Note the @/@ before a @QueryParam@!
29−module Servant.Utils.ApiQuasiQuoting where
29+module Servant.QQ where
30
30
31import Control.Monad (void)
31import Control.Monad (void)
32import Control.Applicative hiding (many, (<|>), optional)
32import Control.Applicative hiding (many, (<|>), optional)
@@ -177,18 +177,14 @@ parseAll = do
177-- | The sitemap QuasiQuoter.
177-- | The sitemap QuasiQuoter.
178--
178--
179-- * @.../<var>:<type>/...@ becomes a capture
179-- * @.../<var>:<type>/...@ becomes a capture
180−--
181-- * @.../?<var>:<type>@ becomes a query parameter
180-- * @.../?<var>:<type>@ becomes a query parameter
182−--
183-- * @<method> ... <typ>@ becomes a method returning @<typ>@
181-- * @<method> ... <typ>@ becomes a method returning @<typ>@
184−--
185-- * @<method> ... <typ1> -> <typ2>@ becomes a method with request
182-- * @<method> ... <typ1> -> <typ2>@ becomes a method with request
186-- body of @<typ1>@ and returning @<typ2>@
183-- body of @<typ1>@ and returning @<typ2>@
187--
184--
188-- Comments are allowed, and have the standard Haskell format
185-- Comments are allowed, and have the standard Haskell format
189--
186--
190-- * @--@ for inline
187-- * @--@ for inline
191−--
192-- * @{- ... -}@ for block
188-- * @{- ... -}@ for block
193--
189--
194sitemap :: QuasiQuoter
190sitemap :: QuasiQuoter
src/Servant/Utils/Links.hs+1
@@ -9,6 +9,7 @@
9-- | Type safe internal links.
9-- | Type safe internal links.
10--
10--
11-- Provides the function 'mkLink':
11-- Provides the function 'mkLink':
12+--
12-- @
13-- @
13-- type API = Proxy ("hello" :> Get Int
14-- type API = Proxy ("hello" :> Get Int
14-- :<|> "bye" :> QueryParam "name" String :> Post Bool)
15-- :<|> "bye" :> QueryParam "name" String :> Post Bool)
test/Servant/Utils/ApiQuasiQuotingSpec.hs → test/Servant/QQSpec.hsrenamed+1−1
@@ -7,7 +7,7 @@
7{-# LANGUAGE TypeFamilies #-}
7{-# LANGUAGE TypeFamilies #-}
8{-# LANGUAGE TypeOperators #-}
8{-# LANGUAGE TypeOperators #-}
9{-# LANGUAGE UndecidableInstances #-}
9{-# LANGUAGE UndecidableInstances #-}
10−module Servant.Utils.ApiQuasiQuotingSpec where
10+module Servant.Utils.QQSpec where
11
11
12import Test.Hspec
12import Test.Hspec
13
13