{"id":15818517,"url":"https://github.com/avanov/liquid-haskell-parsing-demo","last_synced_at":"2025-04-01T05:13:47.851Z","repository":{"id":146881946,"uuid":"331486264","full_name":"avanov/liquid-haskell-parsing-demo","owner":"avanov","description":"A small demo of how Liquid Haskell and refinement types can aid API design","archived":false,"fork":false,"pushed_at":"2021-01-22T21:29:30.000Z","size":21,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-12T06:59:09.716Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Nix","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/avanov.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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-01-21T02:01:10.000Z","updated_at":"2021-11-06T00:07:43.000Z","dependencies_parsed_at":null,"dependency_job_id":"990f1dc9-ed3b-44db-ab4e-6d2dcf538753","html_url":"https://github.com/avanov/liquid-haskell-parsing-demo","commit_stats":{"total_commits":8,"total_committers":1,"mean_commits":8.0,"dds":0.0,"last_synced_commit":"e39d3e5c359368d7c34656b1cc3349ac544613b2"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avanov%2Fliquid-haskell-parsing-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avanov%2Fliquid-haskell-parsing-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avanov%2Fliquid-haskell-parsing-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avanov%2Fliquid-haskell-parsing-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/avanov","download_url":"https://codeload.github.com/avanov/liquid-haskell-parsing-demo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246586036,"owners_count":20801028,"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-10-05T06:02:31.560Z","updated_at":"2025-04-01T05:13:47.833Z","avatar_url":"https://github.com/avanov.png","language":"Nix","funding_links":[],"categories":[],"sub_categories":[],"readme":"Liquid Haskell Example\n======================\n\nThis is a self-contained [Liquid Haskell](https://ucsd-progsys.github.io/liquidhaskell-blog/) example.\n\n```bash\nnix-shell --run \"make run\"\n```\n\n\nConsider the function [`apiCallProvideRedundancy`](https://github.com/avanov/liquid-haskell-parsing-demo/blob/460f1fd8e352fe815ea41920d9a3683d10e3026d/app/Main.hs#L36-L42).\n\nImagine it's a part of \"Core API\" that needs to be safe and free from redundant case-analysis of input data.\nLiquid Haskell helps us to express types and filter values based on predicates that go beyond `NonEmpty` kinds of constructors.\nAs soon as I declare that `type Destinations` is a list of at least two non-empty textual values,\nthe compiler requires me to prove that the data I call `apiCallProvideRedundancy` with does satisfy\nthat criteria of the firsrt argument.\nHence [the helper parsing functions](https://github.com/avanov/liquid-haskell-parsing-demo/blob/460f1fd8e352fe815ea41920d9a3683d10e3026d/app/Main.hs#L49-L76)\nhave to exist at the boundaries of my API, and not somewhere inside `apiCallProvideRedundancy`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favanov%2Fliquid-haskell-parsing-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Favanov%2Fliquid-haskell-parsing-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favanov%2Fliquid-haskell-parsing-demo/lists"}