{"id":18221686,"url":"https://github.com/kamirus/purescript-functional-concepts","last_synced_at":"2026-01-21T19:34:29.889Z","repository":{"id":235621064,"uuid":"155065146","full_name":"Kamirus/purescript-functional-concepts","owner":"Kamirus","description":"Elaborated examples concerning functional concepts e.g. gadt, eadt, church encodings","archived":false,"fork":false,"pushed_at":"2024-10-16T10:06:43.000Z","size":33,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-07T23:42:08.018Z","etag":null,"topics":["church-encoding","eadt","exists","gadt","gadts","higher-order-functions","leibniz-equality","row-polymorphism","tagless","typeclasses"],"latest_commit_sha":null,"homepage":"","language":"PureScript","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/Kamirus.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-10-28T11:46:06.000Z","updated_at":"2024-10-16T10:06:47.000Z","dependencies_parsed_at":null,"dependency_job_id":"a1cc002d-c0cd-4ca9-9c6d-66925781049b","html_url":"https://github.com/Kamirus/purescript-functional-concepts","commit_stats":null,"previous_names":["kamirus/purescript-functional-concepts"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Kamirus/purescript-functional-concepts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kamirus%2Fpurescript-functional-concepts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kamirus%2Fpurescript-functional-concepts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kamirus%2Fpurescript-functional-concepts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kamirus%2Fpurescript-functional-concepts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Kamirus","download_url":"https://codeload.github.com/Kamirus/purescript-functional-concepts/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kamirus%2Fpurescript-functional-concepts/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28641273,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-21T18:04:35.752Z","status":"ssl_error","status_checked_at":"2026-01-21T18:03:55.054Z","response_time":86,"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":["church-encoding","eadt","exists","gadt","gadts","higher-order-functions","leibniz-equality","row-polymorphism","tagless","typeclasses"],"created_at":"2024-11-03T22:03:55.743Z","updated_at":"2026-01-21T19:34:29.868Z","avatar_url":"https://github.com/Kamirus.png","language":"PureScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Purescript - functional concepts\n\nHow to run?\n - using pulp: `$ pulp run --main \u003cfile\u003e`\n\n## Files\n\n#### Equal\n\nLeibniz equality pure implementation\n\n#### Exists and Exists.Example\n\nExists implementation without GADTs nor cheats\n\nExample shows simple uses, and points out that sometimes we need some constraints for 'hidden' type.\nThat would require to write new Exists data type for such use case. Further research is needed in this field.\n\n#### GADTs/ExprLeibnizTagless\n\nExpress `Expr a` GADT without this extension\n - using Leibniz equality \n - using tagless approach \n\n```haskell\ndata Expr a where\n  I   ∷ Int  → Expr Int\n  B   ∷ Bool → Expr Bool\n  Add ∷ Expr Int → Expr Int → Expr Int\n  Eq  ∷ Eq a ⇒ Expr a → Expr a → Expr Bool\n\neval ∷ Expr a → a\neval (I n) = n\neval (B b) = b\neval (Add e1 e2) = eval e1 + eval e2\neval (Eq  e1 e2) = eval e1 == eval e2\n```\n\n\n#### GADTs/ExprIf\n\nSimple tagless form for operations: `+` and `if`\n\n\n#### Tagless\n\n[tagless-final embedding of the simply-typed lambda-calculus with integers and constants, and its uniform interpretations with three different evaluation strategies: call-by-name, call-by-value and call-by-need](http://okmij.org/ftp/tagless-final/cookbook.html#call-by-any)\n\nOn why tagless final is better than Leibniz - https://hgiasac.github.io/posts/2018-12-18-PureScript-GADTs-Alternatives---Recap.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkamirus%2Fpurescript-functional-concepts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkamirus%2Fpurescript-functional-concepts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkamirus%2Fpurescript-functional-concepts/lists"}