| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Servant.API.Alternative
Documentation
Union of two APIs, first takes precedence in case of overlap.
Example:
type MyApi = "books" :> Get [Book] -- GET /books
:<|> "books" :> ReqBody Book :> Post Book -- POST /booksConstructors
| a :<|> b infixr 8 |
Instances
| (HasServer a, HasServer b) => HasServer ((:<|>) a b) | A server for type MyApi = "books" :> Get [Book] -- GET /books
:<|> "books" :> ReqBody Book :> Post Book -- POST /books
server :: Server MyApi
server = listAllBooks :<|> postBook
where listAllBooks = ...
postBook book = ... |
| type Server ((:<|>) a b) = (:<|>) (Server a) (Server b) |