Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data Capture sym a
Documentation
Capture a value from the request path under a certain type a
.
Example:
-- GET /books/:isbn type MyApi = "books" :> Capture "isbn" Text :> Get Book
(KnownSymbol capture, FromText a, HasServer sublayout) => HasServer ((:>) * (Capture Symbol * capture a) sublayout) | If you use You can control how it'll be converted from Example: type MyApi = "books" :> Capture "isbn" Text :> Get Book server :: Server MyApi server = getBook where getBook :: Text -> EitherT (Int, String) IO Book getBook isbn = ... |
type Server ((:>) * (Capture Symbol * capture a) sublayout) = a -> Server sublayout |