TeamTavern uses shared PureScript types to unify HTTP client and server routing
TeamTavern, an online teammate-finding platform, is built entirely in PureScript with both its browser app and API server sharing a single codebase compiled by one build tool. Every HTTP endpoint is defined as a single type-level route, from which the server handler and client call are both automatically derived. The routing library used is Jarilo, which follows a similar philosophy to Haskell's Servant, encoding path, request body, and all possible responses directly into the type. The compiler enforces correctness end-to-end: handler argument types, return types, and response variants are all inferred from the shared route type, making mismatches a compile-time error. This architecture eliminates an entire class of client-server contract bugs by ensuring neither side can reference a response or parameter that the route does not declare.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in