{"id":18000181,"url":"https://github.com/positiondev/fn","last_synced_at":"2025-03-26T07:32:05.473Z","repository":{"id":1864916,"uuid":"44848908","full_name":"positiondev/fn","owner":"positiondev","description":"A functional web framework","archived":false,"fork":false,"pushed_at":"2022-01-22T14:50:38.000Z","size":140,"stargazers_count":34,"open_issues_count":6,"forks_count":7,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-10-30T00:34:12.831Z","etag":null,"topics":["functional","haskell","web-framework"],"latest_commit_sha":null,"homepage":"http://fnhaskell.com","language":"Haskell","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/positiondev.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":"2015-10-24T02:27:25.000Z","updated_at":"2024-05-03T18:14:02.000Z","dependencies_parsed_at":"2022-08-06T11:15:18.011Z","dependency_job_id":null,"html_url":"https://github.com/positiondev/fn","commit_stats":null,"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/positiondev%2Ffn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/positiondev%2Ffn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/positiondev%2Ffn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/positiondev%2Ffn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/positiondev","download_url":"https://codeload.github.com/positiondev/fn/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245611789,"owners_count":20643894,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["functional","haskell","web-framework"],"created_at":"2024-10-29T23:10:15.596Z","updated_at":"2025-03-26T07:32:04.310Z","avatar_url":"https://github.com/positiondev.png","language":"Haskell","readme":"## Fn (eff-enn) - a functional web framework.\n\n\u003e Or, how to do away with the monad transformers, and just use plain\n\u003e functions.\n\n## Example\n\nSee the `example` directory for a full example, but a minimal\napplication is the following:\n\n\n```haskell\n{-# LANGUAGE OverloadedStrings #-}\n{-# LANGUAGE TemplateHaskell   #-}\n\nimport           Control.Lens\nimport           Data.Monoid\nimport           Data.Text                (Text)\nimport qualified Data.Text                as T\nimport           Network.HTTP.Types\nimport           Network.Wai\nimport           Network.Wai.Handler.Warp\nimport qualified Network.Wai.Util         as W\nimport           Web.Fn\n\ndata Ctxt = Ctxt { _req :: Request\n                 }\n\nmakeLenses ''Ctxt\n\ninstance RequestContext Ctxt where\n  requestLens = req\n\ninitializer :: IO Ctxt\ninitializer = return (Ctxt defaultRequest)\n\nmain :: IO ()\nmain = do context \u003c- initializer\n          run 8000 $ toWAI context app\n\napp :: Ctxt -\u003e IO Response\napp ctxt =\n  route ctxt [ end ==\u003e index\n             , path \"foo\" // segment // path \"baz\" // param \"id\" ==\u003e handler]\n    `fallthrough` notFoundText \"Page not found.\"\n\nindex :: IO (Maybe Response)\nindex = okText \"This is the index page! Try /foo/bar/baz?id=10\"\n\nhandler :: Text -\u003e Int -\u003e Ctxt -\u003e IO (Maybe Response)\nhandler fragment i _ = okText (fragment \u003c\u003e \" - \" \u003c\u003e T.pack (show i))\n\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpositiondev%2Ffn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpositiondev%2Ffn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpositiondev%2Ffn/lists"}