Explicit imports in /src.

This commit is contained in:
Matthias Fischmann 2015-01-06 17:25:25 +01:00
parent 6835f0559a
commit 2f9c6340c4
3 changed files with 22 additions and 19 deletions

View file

@ -11,10 +11,12 @@ module Servant.Server
HasServer(..) HasServer(..)
) where ) where
import Data.Proxy import Data.Proxy (Proxy)
import Network.Wai import Network.Wai (Application)
import Servant.Server.Internal import Servant.Server.Internal
-- * Implementing Servers -- * Implementing Servers
-- | 'serve' allows you to implement an API and produce a wai 'Application'. -- | 'serve' allows you to implement an API and produce a wai 'Application'.
@ -30,7 +32,7 @@ import Servant.Server.Internal
-- > postBook book = ... -- > postBook book = ...
-- > -- >
-- > myApi :: Proxy MyApi -- > myApi :: Proxy MyApi
-- > myApi = Proxy -- > myApi = Proxy
-- > -- >
-- > app :: Application -- > app :: Application
-- > app = serve myApi server -- > app = serve myApi server
@ -39,4 +41,3 @@ import Servant.Server.Internal
-- > main = Network.Wai.Handler.Warp.run 8080 app -- > main = Network.Wai.Handler.Warp.run 8080 app
serve :: HasServer layout => Proxy layout -> Server layout -> Application serve :: HasServer layout => Proxy layout -> Server layout -> Application
serve p server = toApplication (route p server) serve p server = toApplication (route p server)

View file

@ -7,24 +7,26 @@
{-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE ScopedTypeVariables #-}
module Servant.Server.Internal where module Servant.Server.Internal where
import Control.Applicative import Control.Applicative ((<$>))
import Control.Monad.Trans.Either import Control.Monad.Trans.Either (EitherT, runEitherT)
import Data.Aeson import Data.Aeson (ToJSON, FromJSON, encode, decode')
import qualified Data.ByteString as B import qualified Data.ByteString as B
import qualified Data.ByteString.Lazy as BL import qualified Data.ByteString.Lazy as BL
import Data.IORef import Data.IORef (newIORef, readIORef, writeIORef)
import Data.Maybe (catMaybes) import Data.Maybe (catMaybes)
import Data.Monoid import Data.Monoid (Monoid, mempty, mappend)
import Data.Proxy import Data.Proxy (Proxy(Proxy))
import Data.String import Data.String (fromString)
import Data.String.Conversions import Data.String.Conversions (cs, (<>))
import Data.Text.Encoding (decodeUtf8) import Data.Text.Encoding (decodeUtf8)
import Data.Text (Text) import Data.Text (Text)
import GHC.TypeLits import GHC.TypeLits (KnownSymbol, symbolVal)
import Network.HTTP.Types hiding (Header) import Network.HTTP.Types hiding (Header)
import Network.Wai import Network.Wai (Response, Request, ResponseReceived, Application, pathInfo, requestBody,
import Servant.API strictRequestBody, lazyRequestBody, requestHeaders, requestMethod,
import Servant.Common.Text rawQueryString, responseLBS)
import Servant.API (QueryParams, QueryParam, QueryFlag, ReqBody, Header, Capture, Get, Delete, Put, Post, Raw, (:>), (:<|>)(..))
import Servant.Common.Text (FromText, fromText)
data ReqBodyState = Uncalled data ReqBodyState = Uncalled
| Called !B.ByteString | Called !B.ByteString

View file

@ -7,9 +7,9 @@ module Servant.Utils.StaticFiles (
) where ) where
import Filesystem.Path.CurrentOS (decodeString) import Filesystem.Path.CurrentOS (decodeString)
import Network.Wai.Application.Static import Network.Wai.Application.Static (staticApp, defaultFileServerSettings)
import Servant.API.Raw import Servant.API.Raw (Raw)
import Servant.Server.Internal import Servant.Server.Internal (Server)
-- | Serve anything under the specified directory as a 'Raw' endpoint. -- | Serve anything under the specified directory as a 'Raw' endpoint.
-- --