Conditionally apply a middleware based on a request predicate.
If the predicate returns some middleware, apply it; otherwise pass through.
$$\text{select} : (\text{Request} \to \text{Option Middleware}) \to \text{Middleware}$$
Equations
- Network.Wai.Middleware.select choose app req respond = match choose req with | some mid => mid app req respond | none => app req respond