Skip to content

Instantly share code, notes, and snippets.

@anfedorov
Created January 6, 2010 18:02
Show Gist options
  • Save anfedorov/270477 to your computer and use it in GitHub Desktop.
Save anfedorov/270477 to your computer and use it in GitHub Desktop.
"Maximally functional" HTTP server
# High level
HTTPServer : (http_request, db) -> (response, db_delta)
# "Internals"
Resolve : http_request -> db_query
Lookup : db, db_query -> data
Respond : http_request, data -> response, db_delta
# Implementation

HTTPServer(http_request, db) = Respond(http_request, Lookup(db, Resolve(http_request)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment