diff --git a/src/Servant.hs b/src/Servant.hs index ac2e4a1e..09b470d1 100644 --- a/src/Servant.hs +++ b/src/Servant.hs @@ -1,8 +1,14 @@ -module Servant - ( module Servant.API - , module Servant.Client - , module Servant.Server - , module Servant.Text +module Servant ( + -- | This module and its submodules can be used to define servant APIs. Note + -- that these API definitions don't directly implement a server (or anything + -- else). + module Servant.API, + -- | For implementing servers for servant APIs. + module Servant.Server, + -- | For accessing servant APIs as API clients. + module Servant.Client, + -- | Helper module + module Servant.Text, ) where import Servant.API diff --git a/src/Servant/API.hs b/src/Servant/API.hs index c35d845e..3945c236 100644 --- a/src/Servant/API.hs +++ b/src/Servant/API.hs @@ -1,11 +1,24 @@ -module Servant.API - ( module Servant.API.Capture - , module Servant.API.Get - , module Servant.API.GetParam - , module Servant.API.Post - , module Servant.API.RQBody - , module Servant.API.Sub - , module Servant.API.Union +module Servant.API ( + + -- * Combinators + -- | Type-level combinator for expressing routing, captures, get parameters, etc. + module Servant.API.Sub, + -- | Type-level combinator for alternative endpoints + module Servant.API.Union, + + -- * Accessing information from the request + -- | Capturing parts of the url path as parsed values + module Servant.API.Capture, + -- | Retrieving parameters from the query part of the 'URI' + module Servant.API.GetParam, + -- | Accessing the request's body + module Servant.API.RQBody, + + -- * Actual endpoints, distinguished by HTTP method + -- | GET requests + module Servant.API.Get, + -- | POST requests + module Servant.API.Post, ) where import Servant.API.Capture @@ -14,4 +27,4 @@ import Servant.API.GetParam import Servant.API.Post import Servant.API.RQBody import Servant.API.Sub -import Servant.API.Union \ No newline at end of file +import Servant.API.Union diff --git a/src/Servant/Server.hs b/src/Servant/Server.hs index 8224943f..193df093 100644 --- a/src/Servant/Server.hs +++ b/src/Servant/Server.hs @@ -1,5 +1,10 @@ {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE OverloadedStrings #-} + +-- | This module lets you implement 'Server's for defined APIs. You will +-- probably need 'serve' (and look at the 'HasServer' type family), but +-- 'toApplication' and 'route' are rather internals. + module Servant.Server where import Data.Proxy