Safe Haskell | None |
---|---|
Language | Haskell2010 |
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
!
Documentation
The sitemap QuasiQuoter.
...var:type...
becomes a capture.../?var:type
becomes a query parametermethod ... typ
becomes a method returningtyp
method ... typ1 -> typ2
becomes a method with request body oftyp1
and returningtyp2
Comments are allowed, and have the standard Haskell format
--
for inline{- ... -}
for block