{"id":24865523,"url":"https://github.com/kfl/webserver-functor","last_synced_at":"2026-01-30T06:06:56.419Z","repository":{"id":14498082,"uuid":"17211145","full_name":"kfl/webserver-functor","owner":"kfl","description":"Example code demonstrating how SML modules, in particular functors, can be used for structuring a web framework.","archived":false,"fork":false,"pushed_at":"2014-02-26T13:17:17.000Z","size":104,"stargazers_count":13,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-10T10:49:12.640Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Standard ML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kfl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-02-26T13:16:56.000Z","updated_at":"2025-04-04T02:24:17.000Z","dependencies_parsed_at":"2022-09-02T16:58:16.903Z","dependency_job_id":null,"html_url":"https://github.com/kfl/webserver-functor","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kfl/webserver-functor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kfl%2Fwebserver-functor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kfl%2Fwebserver-functor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kfl%2Fwebserver-functor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kfl%2Fwebserver-functor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kfl","download_url":"https://codeload.github.com/kfl/webserver-functor/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kfl%2Fwebserver-functor/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28906238,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-30T04:02:34.702Z","status":"ssl_error","status_checked_at":"2026-01-30T04:02:33.562Z","response_time":66,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-31T23:59:59.740Z","updated_at":"2026-01-30T06:06:56.385Z","avatar_url":"https://github.com/kfl.png","language":"Standard ML","funding_links":[],"categories":[],"sub_categories":[],"readme":"App Webserver As a Functor\n==========================\n\nExample code demonstrating how SML modules, in particular functors,\ncan be used for structuring a web framework.\n\nThe code in its current state is only useful for demonstration, it is\n**not** ready for production. Also, it's probably a bit far fetched to\ncall the current code a \"framework\".\n\n\nArchitecture\n------------\n\nThe overall idea is that you make a web-application by implementing a\nstructure, say `App`, with the signature `WebApp`. Then you give `App`\nto a functor which will then take care of creating a web server (or in\ncommunicate with one).\n\nThe framework consists of two files:\n\n* `HtmlUtils.sml` contains a structure `HtmlUtils` where the type\n  `reply` for HTTP replies is declared, the module also contains some\n  simple-mined (read inefficient) utility functions for creating HTML\n  pages.\n\n* `WebServerFct.sml` contains the signature `WebApp` and the functor\n  `WebServerFct`.\n\n\nExamples\n--------\n\nCompile the examples with the command:\n\n~~~\n$ mosmlc -toplevel HtmlUtils.sml WebServerFct.sml App.sml -o appserver\n~~~\n\nWhere `App.sml` is the example you want to compile.\n\n* `CountingEcho.sml` an echo server, that also counts how many\n  times it has been called.\n\n* `PhonebookApp.sml` an phonebook with shared state across clients.\n   Uses an in-memory \"database\" implemented as a list.\n\n   Shows how to deal (rudimentary) with the query\n   path of an URL (\u003chttp://en.wikipedia.org/wiki/Query_string\u003e).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkfl%2Fwebserver-functor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkfl%2Fwebserver-functor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkfl%2Fwebserver-functor/lists"}