on master help sign in
Explicit imports in /src.
commit40b13a9c86ee054fcdcc600df0876dc7f45933e1 authorMatthias Fischmann <mf@zerobuzz.net> dateTue 6 Jan 2015, 17:54 (12 years ago) parent9b10181
9 files changed+65−49
src/Servant/API.hs+13−13 src/Servant/API/Delete.hs+1−1 src/Servant/API/Get.hs+1−1 src/Servant/API/Post.hs+1−1 src/Servant/API/Put.hs+1−1 src/Servant/API/Sub.hs+1−1 src/Servant/Common/Text.hs+5−5 src/Servant/QQ.hs+31−14 src/Servant/Utils/Links.hs+11−12
src/Servant/API.hs+13−13
@@ -37,16 +37,16 @@ module Servant.API (
3737 module Servant.Utils.Links,
3838 ) where
3939
40−import Servant.API.Alternative
41−import Servant.API.Capture
42−import Servant.API.Delete
43−import Servant.API.Get
44−import Servant.API.Header
45−import Servant.API.Post
46−import Servant.API.Put
47−import Servant.API.QueryParam
48−import Servant.API.Raw
49−import Servant.API.ReqBody
50−import Servant.API.Sub
51−import Servant.QQ (sitemap)
52−import Servant.Utils.Links (mkLink)
40+import Servant.API.Alternative ( (:<|>)(..) )
41+import Servant.API.Capture ( Capture )
42+import Servant.API.Delete ( Delete )
43+import Servant.API.Get ( Get )
44+import Servant.API.Header ( Header )
45+import Servant.API.Post ( Post )
46+import Servant.API.Put ( Put )
47+import Servant.API.QueryParam ( QueryFlag, QueryParams, QueryParam )
48+import Servant.API.Raw ( Raw )
49+import Servant.API.ReqBody ( ReqBody )
50+import Servant.API.Sub ( (:>)(..) )
51+import Servant.QQ ( sitemap )
52+import Servant.Utils.Links ( mkLink )
src/Servant/API/Delete.hs+1−1
@@ -1,7 +1,7 @@
11{-# LANGUAGE DeriveDataTypeable #-}
22module Servant.API.Delete where
33
4−import Data.Typeable
4+import Data.Typeable ( Typeable )
55
66-- | Combinator for DELETE requests.
77--
src/Servant/API/Get.hs+1−1
@@ -1,7 +1,7 @@
11{-# LANGUAGE DeriveDataTypeable #-}
22module Servant.API.Get where
33
4−import Data.Typeable
4+import Data.Typeable ( Typeable )
55
66-- | Endpoint for simple GET requests. Serves the result as JSON.
77--
src/Servant/API/Post.hs+1−1
@@ -1,7 +1,7 @@
11{-# LANGUAGE DeriveDataTypeable #-}
22module Servant.API.Post where
33
4−import Data.Typeable
4+import Data.Typeable ( Typeable )
55
66-- | Endpoint for POST requests. The type variable represents the type of the
77-- response body (not the request body, use 'Servant.API.ReqBody.ReqBody' for
src/Servant/API/Put.hs+1−1
@@ -1,7 +1,7 @@
11{-# LANGUAGE DeriveDataTypeable #-}
22module Servant.API.Put where
33
4−import Data.Typeable
4+import Data.Typeable ( Typeable )
55
66-- | Endpoint for PUT requests, usually used to update a ressource.
77-- The type @a@ is the type of the response body that's returned.
src/Servant/API/Sub.hs+1−1
@@ -2,7 +2,7 @@
22{-# LANGUAGE TypeOperators #-}
33module Servant.API.Sub where
44
5−import Data.Proxy
5+import Data.Proxy ( Proxy )
66
77-- | The contained API (second argument) can be found under @("/" ++ path)@
88-- (path being the first argument).
src/Servant/Common/Text.hs+5−5
@@ -6,11 +6,11 @@ module Servant.Common.Text
66 , ToText(..)
77 ) where
88
9−import Data.String.Conversions
10−import Data.Int
11−import Data.Text
12−import Data.Text.Read
13−import Data.Word
9+import Data.String.Conversions ( cs )
10+import Data.Int ( Int8, Int16, Int32, Int64 )
11+import Data.Text ( Text )
12+import Data.Text.Read ( rational, signed, decimal, Reader )
13+import Data.Word ( Word, Word8, Word16, Word32, Word64 )
1414
1515-- | For getting values from url captures and query string parameters
1616class FromText a where
src/Servant/QQ.hs+31−14
@@ -28,21 +28,39 @@
2828-- Note the @/@ before a @QueryParam@!
2929module Servant.QQ (sitemap) where
3030
31−import Control.Monad (void)
32−import Control.Applicative hiding (many, (<|>), optional)
33−import Language.Haskell.TH.Quote
31+import Control.Monad ( void )
32+import Control.Applicative ( (<$>) )
33+import Language.Haskell.TH.Quote ( QuasiQuoter(..) )
3434import Language.Haskell.TH
35+ ( mkName, Type(AppT, ConT, LitT), TyLit(StrTyLit) )
3536import Text.ParserCombinators.Parsec
36−
37−import Servant.API.Capture
38−import Servant.API.Get
39−import Servant.API.Post
40−import Servant.API.Put
41−import Servant.API.Delete
42−import Servant.API.QueryParam
43−import Servant.API.ReqBody
44−import Servant.API.Sub
45−import Servant.API.Alternative
37+ ( try,
38+ Parser,
39+ manyTill,
40+ endBy,
41+ sepBy1,
42+ optional,
43+ optionMaybe,
44+ string,
45+ anyChar,
46+ char,
47+ spaces,
48+ noneOf,
49+ parse,
50+ skipMany,
51+ many,
52+ lookAhead,
53+ (<|>),
54+ (<?>) )
55+import Servant.API.Capture ( Capture )
56+import Servant.API.Get ( Get )
57+import Servant.API.Post ( Post )
58+import Servant.API.Put ( Put )
59+import Servant.API.Delete ( Delete )
60+import Servant.API.QueryParam ( QueryParam )
61+import Servant.API.ReqBody ( ReqBody )
62+import Servant.API.Sub ( (:>) )
63+import Servant.API.Alternative ( (:<|>) )
4664
4765-- | Finally-tagless encoding for our DSL.
4866-- Keeping 'repr'' and 'repr' distinct when writing functions with an
@@ -195,4 +213,3 @@ sitemap = QuasiQuoter { quoteExp = undefined
195213 Right st -> return st
196214 , quoteDec = undefined
197215 }
198−
src/Servant/Utils/Links.hs+11−12
@@ -48,18 +48,18 @@ module Servant.Utils.Links (
4848 , IsLink
4949 )where
5050
51−import Data.Proxy
52−import GHC.TypeLits
51+import Data.Proxy ( Proxy(..) )
52+import GHC.TypeLits ( KnownSymbol, Symbol, symbolVal )
5353
54−import Servant.API.Capture
55−import Servant.API.ReqBody
56−import Servant.API.QueryParam
57−import Servant.API.Get
58−import Servant.API.Post
59−import Servant.API.Put
60−import Servant.API.Delete
61−import Servant.API.Sub
62−import Servant.API.Alternative
54+import Servant.API.Capture ( Capture )
55+import Servant.API.ReqBody ( ReqBody )
56+import Servant.API.QueryParam ( QueryParam )
57+import Servant.API.Get ( Get )
58+import Servant.API.Post ( Post )
59+import Servant.API.Put ( Put )
60+import Servant.API.Delete ( Delete )
61+import Servant.API.Sub ( type (:>) )
62+import Servant.API.Alternative ( type (:<|>) )
6363
6464
6565type family Or a b where
@@ -123,4 +123,3 @@ instance VLinkHelper (Get x) where
123123
124124instance VLinkHelper (Post x) where
125125 vlh _ = ""
126−