{"id":16336501,"url":"https://github.com/justinwoo/purescript-home-run-ball","last_synced_at":"2026-02-14T22:33:30.790Z","repository":{"id":58225396,"uuid":"102390040","full_name":"justinwoo/purescript-home-run-ball","owner":"justinwoo","description":"A library for applying a row of rules for validation to refine a value","archived":false,"fork":false,"pushed_at":"2018-06-20T20:19:16.000Z","size":11,"stargazers_count":12,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-09T01:17:09.181Z","etag":null,"topics":["purescript","refinement","row-types","validation"],"latest_commit_sha":null,"homepage":"","language":"PureScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/justinwoo.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}},"created_at":"2017-09-04T18:22:27.000Z","updated_at":"2019-09-12T07:44:10.000Z","dependencies_parsed_at":"2022-08-31T03:24:03.630Z","dependency_job_id":null,"html_url":"https://github.com/justinwoo/purescript-home-run-ball","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/justinwoo/purescript-home-run-ball","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justinwoo%2Fpurescript-home-run-ball","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justinwoo%2Fpurescript-home-run-ball/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justinwoo%2Fpurescript-home-run-ball/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justinwoo%2Fpurescript-home-run-ball/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/justinwoo","download_url":"https://codeload.github.com/justinwoo/purescript-home-run-ball/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justinwoo%2Fpurescript-home-run-ball/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29256509,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-09T04:11:57.159Z","status":"ssl_error","status_checked_at":"2026-02-09T04:11:56.117Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["purescript","refinement","row-types","validation"],"created_at":"2024-10-10T23:44:22.808Z","updated_at":"2026-02-14T22:33:30.750Z","avatar_url":"https://github.com/justinwoo.png","language":"PureScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Purescript Home Run Ball\n\n[![Build Status](https://travis-ci.org/justinwoo/purescript-home-run-ball.svg)](https://travis-ci.org/justinwoo/purescript-home-run-ball)\n\nA library for applying a row of rules for validation on any values, returning the original data with the rules applied or a list of the rules that failed.\n\n![](http://i.imgur.com/VOYNDVW.png)\n\nSee the [blog post](https://qiita.com/kimagure/items/eeb40541fc56b8dba2cc) about this library.\n\n## Example\n\n@joneshf made a cool demo [here](https://github.com/joneshf/purescript-home-run-ball-demo) showing off this library and [Sparkle](https://github.com/sharkdp/purescript-sparkle).\n\nHere's some selected excerpts from the tests:\n\n```hs\nonlyOnApples ::\n     ValidatedValue (beginsApple :: BeginsWith \"Apple\") String\n  -\u003e String\nonlyOnApples _ = \"U R COOL\"\n\nvalidOf :: forall a errors rules rl\n   . RowToList rules rl\n  =\u003e CheckRules rl errors rules a\n  =\u003e RProxy rules\n  -\u003e a\n  -\u003e V (NonEmptyList (Variant errors)) a\nvalidOf _ s = pure s\n\nrules = RProxy :: RProxy (beginsApple :: BeginsWith \"Apple\")\n\nexpected :: V (NonEmptyList (Variant (beginsApple :: String))) String\nexpected = validOf rules \"U R COOL\"\n\nmain :: _\nmain = run [consoleReporter] do\n  describe \"purescript-home-run-ball\" do\n    it \"works with valid string\" do\n      let\n        checkedString = checkRules rules \"AppleSDdf\"\n      isValid checkedString `shouldEqual` true\n      expected `shouldEqual` (onlyOnApples \u003c$\u003e checkedString)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjustinwoo%2Fpurescript-home-run-ball","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjustinwoo%2Fpurescript-home-run-ball","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjustinwoo%2Fpurescript-home-run-ball/lists"}