TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: Servant – A Haskell web framework with type-level API DSL

55 pointsby jkarniabout 10 years ago

2 comments

jkarniabout 10 years ago
We came up with a way of reifying specifications of web APIs at the type level, and built a web framework around it. The basic idea was, I believe, first developed by Ralf Lämmel and Klaus Ostermann [0], as a Haskell solution to the expression problem, but I think it&#x27;s the first large-scale application of these ideas.<p>Checking for correctness and deriving functionality from that comes pretty naturally after that, so it&#x27;s easy to reduce boilerplate (e.g., generate client libraries and documentation automatically) and make static guarantees (e.g., that a link exists within an API, and won&#x27;t 404).<p>[0] <a href="http:&#x2F;&#x2F;www.informatik.uni-marburg.de&#x2F;~kos&#x2F;papers&#x2F;gpce06.pdf" rel="nofollow">http:&#x2F;&#x2F;www.informatik.uni-marburg.de&#x2F;~kos&#x2F;papers&#x2F;gpce06.pdf</a>
PhineasRexabout 10 years ago
Having the type-system statically verify that your API is correct and that your usage of it is correct, but oof, that syntax is quite hard to read. I wonder if you could use Template Haskell to generate that from an easier-to-read routes file similar to Yesod.
评论 #9520996 未加载