{"id":21027290,"url":"https://github.com/bynect/system-f","last_synced_at":"2025-03-13T18:45:40.215Z","repository":{"id":107042744,"uuid":"440634010","full_name":"bynect/system-f","owner":"bynect","description":null,"archived":false,"fork":false,"pushed_at":"2022-01-12T08:26:03.000Z","size":89,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-20T14:39:58.821Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bynect.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-12-21T19:50:30.000Z","updated_at":"2022-01-10T16:41:09.000Z","dependencies_parsed_at":null,"dependency_job_id":"7b5db587-1938-460d-b798-5f4de0f3f869","html_url":"https://github.com/bynect/system-f","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bynect%2Fsystem-f","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bynect%2Fsystem-f/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bynect%2Fsystem-f/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bynect%2Fsystem-f/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bynect","download_url":"https://codeload.github.com/bynect/system-f/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243464695,"owners_count":20295288,"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":[],"created_at":"2024-11-19T11:49:22.292Z","updated_at":"2025-03-13T18:45:40.193Z","avatar_url":"https://github.com/bynect.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# System F\n\n## Notation\n\nTraditionally the following notation is used in type theoretic documents:\n\n* Terms are denoted by a lowercase e `e`\n* Types are denoted by a lowercase tau `τ`\n* Term variables are denoted by a lowercase x `x`\n* Type variables are denoted by a lowercase alpha `α` (or sometimes a lowercase beta `β`)\n* Typing environments are denoted by an uppercase sigma `Γ`\n* Kinding environments are denoted by an uppercase theta `Θ`\n\n## Syntax\n\nThe syntax of System F is very similar to that of _simply typed lambda calculus_, with the addition of a way to express _universal quantification_.\nThe ML family languages are, at least from a theoretical point, based on System F, which encodes the concept of _parametric polymorphism_.\n\n### Terms\n\n```haskell\ne = x         variable\n  | λx:τ. e   abstraction\n  | Λα. e     type abstraction\n  | e e'      application\n  | e [τ]     type application\n```\n\n### Types\n\n```haskell\nτ = α         type variable\n  | τ → τ'    type function\n  | ∀α. τ     universal quantifier\n```\n\n## Extensions\n\n### Let\n\n\n\n```haskell\nlet x:τ = e in e'\n```\n\nUnlike ML, _let expressions_ can be desugared to abstractions directly in System F.\nThus they are equivalent to `(λx:τ. e') e`.\n\nYou can enable this extension by defining `SUGAR_LET`. FIXME\n\n### System F Omega\n\nTODO\n\n## Usage\n\nThe program runs every file provided in the command line arguments in order, preserving the changes of the previous.\nUpon encountering `-`, even when it is not the last argument, it will start an interactive session.\n\n### Example\n\n```haskell\n$ ./Main Prim.txt -\nI, id = Λα. λx:α. x\nI, id : ∀α. α → α\n-- Other definitions...\nS, succ = λn:nat. Λα. λx:α. λf:α → α. f ((n [α]) x f)\nS, succ : (∀α. α → (α → α) → α) → (∀α. α → (α → α) → α)\nc\u003e -- REPL starts\n```\n\nThis invocation of the program first loads the file [`Prim.txt`](/Prim.txt), which contains some basic definitions (SKI, nats, ...).\nThen it starts an interactive session, preserving the definitions of the aforementioned file.\n\n## Features\n\n### Type checking\n\nEvery expression you enter will be checked.\n\n### Definitions\n\nSubstitutions can be easily defined for both terms and types.\nOlder definitions are shadowed by newer ones.\nTerms and types use two distinct namespaces.\n\n```haskell\n-- Term substitution\nzero = Λα. λx:α. λf:α → α. x\n\n-- Type substitution\nnat = [∀α. α → (α → α) → α]\n```\n\n### Evaluation\n\nNot implemented yet. TODO\n\n### Unicode support\n\nThe REPL accepts the following ASCII alternatives for some Unicode characters.\n\n* `\\` instead of lowercase lambda `λ`\n* `/\\` instead of uppercase lambda `Λ`\n* `-\u003e` instead of unicode arrow `→`\n* `forall` instead of turned uppercase a `∀`\n\nIf `SHOW_UNICODE` is defined Unicode characters are used to print expression, types, etc.\n\n## License\n\nThis project is licensed under the terms and conditions of the Mozilla Public License Version 2.0.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbynect%2Fsystem-f","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbynect%2Fsystem-f","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbynect%2Fsystem-f/lists"}