Header menu logo Falco.UnionRoutes

Returns<'T> Type

Response type marker. Carries type info at compile time for API metadata; holds no runtime data.

Use Returns<'T> to declare what a route handler returns. The value is excluded from path, query, and precondition extraction — it exists only so reflection can discover the response type.

Use Route.respond to send the response with the correct type.

Example

 type FortuneRoute =
     | List of Returns<Fortune list>
     | Show of id: Guid * Returns<Fortune>

 let handle route : HttpHandler =
     match route with
     | List returns -> Route.respond returns (Fortune.all ())
     | Show (id, returns) -> Route.respond returns (Fortune.find id)
type FortuneRoute = | List of obj | Show of id: obj * obj
Multiple items
module List from Microsoft.FSharp.Collections

--------------------
type List<'T> = | op_Nil | op_ColonColon of Head: 'T * Tail: 'T list interface IReadOnlyList<'T> interface IReadOnlyCollection<'T> interface IEnumerable interface IEnumerable<'T> member GetReverseIndex: rank: int * offset: int -> int member GetSlice: startIndex: int option * endIndex: int option -> 'T list static member Cons: head: 'T * tail: 'T list -> 'T list member Head: 'T with get member IsEmpty: bool with get member Item: index: int -> 'T with get ...
type 'T list = List<'T>
val id: x: 'T -> 'T
val handle: route: FortuneRoute -> 'a
val route: FortuneRoute
Multiple items
union case FortuneRoute.List: obj -> FortuneRoute

--------------------
module List from Microsoft.FSharp.Collections

--------------------
type List<'T> = | op_Nil | op_ColonColon of Head: 'T * Tail: 'T list interface IReadOnlyList<'T> interface IReadOnlyCollection<'T> interface IEnumerable interface IEnumerable<'T> member GetReverseIndex: rank: int * offset: int -> int member GetSlice: startIndex: int option * endIndex: int option -> 'T list static member Cons: head: 'T * tail: 'T list -> 'T list member Head: 'T with get member IsEmpty: bool with get member Item: index: int -> 'T with get ...
val returns: obj
union case FortuneRoute.Show: id: obj * obj -> FortuneRoute
val id: obj

Constructors

Constructor Description

Returns()

Full Usage: Returns()

Returns: Returns<'T>
Returns: Returns<'T>

Type something to start searching.