Routing and extraction in Tide: a first sketch

Echoing some comments I posted on Twitter:

I loved Warp’s type-safe parameter extraction and the way it matches that up with the types of functions at compile time, and I don’t see any way to do that in the proposed Tide model. I don’t think you can get compile-time type safety from strings like “/hello/{}”. And I’d like to do better than that.

“Drive endpoint selection solely by URL and HTTP method” seems problematic; for instance, I’d like to be able to drive endpoint selection by logged-in status: "does this method take a User, or an Option<User>". Note that that doesn’t mean I want fallback matching from route to route, just that I’d like to match on criteria like “logged-in user” or “has this HTTP header” or other criteria extractable from the request.

10 Likes