@@ -0,0 +1,32 @@
1+{-# LANGUAGE DataKinds #-}
2+{-# LANGUAGE DeriveDataTypeable #-}
3+{-# LANGUAGE PolyKinds #-}
4+{-# OPTIONS_HADDOCK not-home #-}
5+module Servant.API.Description (Description, Summary) where
6+
7+import Data.Typeable (Typeable)
8+import GHC.TypeLits (Symbol)
9+-- | Add a short summary for (part of) API.
10+--
11+-- Example:
12+--
13+-- >>> type MyApi = Summary "Get book by ISBN." :> "books" :> Capture "isbn" Text :> Get '[JSON] Book
14+data Summary (sym :: Symbol)
15+ deriving (Typeable)
16+
17+-- | Add more verbose description for (part of) API.
18+--
19+-- Example:
20+--
21+-- >>> type MyApi = Description "Some longer implementation details here." :> "books" :> Capture "isbn" Text :> Get '[JSON] Book
22+data Description (sym :: Symbol)
23+ deriving (Typeable)
24+
25+-- $setup
26+-- >>> import Servant.API
27+-- >>> import Data.Aeson
28+-- >>> import Data.Text
29+-- >>> data Book
30+-- >>> instance ToJSON Book where { toJSON = undefined }
31+-- >>> data SourceFile
32+-- >>> instance ToJSON SourceFile where { toJSON = undefined }