servant-0.2.1: A family of combinators for defining webservices APIs

Safe HaskellNone
LanguageHaskell2010

Servant.QQ

Description

QuasiQuoting utilities for API types.

sitemap allows you to write your type in a very natural way:

[sitemap|
PUT        hello                 String -> ()
POST       hello/p:Int           String -> ()
GET        hello/?name:String    Int
|]

Will generate:

       "hello" :> ReqBody String :> Put ()
  :<|> "hello" :> Capture "p" Int :> ReqBody String :> Post ()
  :<|> "hello" :> QueryParam "name" String :> Get Int

Note the / before a QueryParam!

Synopsis

Documentation

sitemap :: QuasiQuoter Source

The sitemap QuasiQuoter.

Comments are allowed, and have the standard Haskell format

  • -- for inline
  • {- ... -} for block