git.iko.soy/typeable/servant
on master help sign in
added documentation
e255b1fSönke Hahn
src/Servant.hs+11−5
@@ -1,8 +1,14 @@
1−module Servant
1+module Servant (
2− ( module Servant.API
2+ -- | This module and its submodules can be used to define servant APIs. Note
3+ -- that these API definitions don't directly implement a server (or anything
4+ -- else).
3− , module Servant.Client
5+ module Servant.API,
6+ -- | For implementing servers for servant APIs.
4− , module Servant.Server
7+ module Servant.Server,
8+ -- | For accessing servant APIs as API clients.
9+ module Servant.Client,
10+ -- | Helper module
5− , module Servant.Text
11+ module Servant.Text,
6 ) where
12 ) where
7
13
8import Servant.API
14import Servant.API
src/Servant/API.hs+22−9
@@ -1,11 +1,24 @@
1−module Servant.API
1+module Servant.API (
2+
3+ -- * Combinators
4+ -- | Type-level combinator for expressing routing, captures, get parameters, etc.
5+ module Servant.API.Sub,
6+ -- | Type-level combinator for alternative endpoints
7+ module Servant.API.Union,
8+
9+ -- * Accessing information from the request
10+ -- | Capturing parts of the url path as parsed values
2− ( module Servant.API.Capture
11+ module Servant.API.Capture,
12+ -- | Retrieving parameters from the query part of the 'URI'
13+ module Servant.API.GetParam,
14+ -- | Accessing the request's body
15+ module Servant.API.RQBody,
16+
17+ -- * Actual endpoints, distinguished by HTTP method
18+ -- | GET requests
3− , module Servant.API.Get
19+ module Servant.API.Get,
4− , module Servant.API.GetParam
20+ -- | POST requests
5− , module Servant.API.Post
21+ module Servant.API.Post,
6− , module Servant.API.RQBody
7− , module Servant.API.Sub
8− , module Servant.API.Union
9 ) where
22 ) where
10
23
11import Servant.API.Capture
24import Servant.API.Capture
@@ -14,4 +27,4 @@ import Servant.API.GetParam
14import Servant.API.Post
27import Servant.API.Post
15import Servant.API.RQBody
28import Servant.API.RQBody
16import Servant.API.Sub
29import Servant.API.Sub
17−import Servant.API.Union
30+import Servant.API.Union
src/Servant/Server.hs+5
@@ -1,5 +1,10 @@
1{-# LANGUAGE TypeFamilies #-}
1{-# LANGUAGE TypeFamilies #-}
2{-# LANGUAGE OverloadedStrings #-}
2{-# LANGUAGE OverloadedStrings #-}
3+
4+-- | This module lets you implement 'Server's for defined APIs. You will
5+-- probably need 'serve' (and look at the 'HasServer' type family), but
6+-- 'toApplication' and 'route' are rather internals.
7+
3module Servant.Server where
8module Servant.Server where
4
9
5import Data.Proxy
10import Data.Proxy