{"id":16336437,"url":"https://github.com/justinwoo/purescript-kushikatsu","last_synced_at":"2026-04-10T05:07:09.861Z","repository":{"id":58231126,"uuid":"133574900","full_name":"justinwoo/purescript-kushikatsu","owner":"justinwoo","description":"Simple routing with Kushiyaki.","archived":false,"fork":false,"pushed_at":"2018-08-05T14:33:11.000Z","size":4,"stargazers_count":9,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-11T16:41:55.323Z","etag":null,"topics":["parsing","purescript","routing","type-level"],"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/justinwoo.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":"2018-05-15T21:23:32.000Z","updated_at":"2024-05-31T16:50:10.000Z","dependencies_parsed_at":"2022-08-30T20:01:46.112Z","dependency_job_id":null,"html_url":"https://github.com/justinwoo/purescript-kushikatsu","commit_stats":null,"previous_names":["justinwoo/purescript-hibachi"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justinwoo%2Fpurescript-kushikatsu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justinwoo%2Fpurescript-kushikatsu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justinwoo%2Fpurescript-kushikatsu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justinwoo%2Fpurescript-kushikatsu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/justinwoo","download_url":"https://codeload.github.com/justinwoo/purescript-kushikatsu/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239412505,"owners_count":19634016,"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":["parsing","purescript","routing","type-level"],"created_at":"2024-10-10T23:44:08.364Z","updated_at":"2025-11-03T07:30:28.018Z","avatar_url":"https://github.com/justinwoo.png","language":"PureScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PureScript-Kushikatsu\n\nSimple routing with [Kushiyaki](https://github.com/justinwoo/purescript-kushiyaki).\n\nWrapped kushiyaki is kushikatsu:\n\n![](https://i.imgur.com/GC18feC.jpg)\n\nRequires PureScript 0.12\n\n## Usage\n\nSetup:\n\n```hs\ntype RouteURLs =\n  ( hello :: RouteURL \"/hello/{name}\"\n  , age :: RouteURL \"/age/{age:Int}\"\n  , answer :: RouteURL \"/gimme/{item:String}/{count:Int}\"\n  )\n\nmain :: Effect Unit\nmain = do\n  let snoc' a xs = Array.snoc xs a\n  ref \u003c- Ref.new []\n\n  let\n    -- inferred type:\n    -- (matchRoutes' :: String\n    --     -\u003e Either\n    --          NoMatch\n    --          (Variant\n    --             ( hello :: { name :: String}\n    --             , age :: { age :: Int }\n    --             , answer :: { item :: String , count :: Int }\n    --             )\n    --         )\n    -- ) =\n    matchRoutes' =\n      matchRoutes (RProxy :: RProxy RouteURLs)\n\n    testRoutes =\n      [ \"/hello/Bill\"\n      , \"/age/12\"\n      , \"/gimme/Apple/24\"\n      , \"/no/match\"\n      ]\n\n    matched = matchRoutes' \u003c$\u003e testRoutes\n    handleResult = case _ of\n      Left (NoMatch l) -\u003e do\n        Ref.modify_ (snoc' $ \"no match: \" \u003c\u003e l) ref\n      Right r -\u003e\n        Variant.match\n          { hello: \\x -\u003e Ref.modify_ (snoc' x.name) ref\n          , age: \\x -\u003e Ref.modify_ (snoc' $ show x.age) ref\n          , answer: \\x -\u003e  Ref.modify_ (snoc' $ show x.count \u003c\u003e \",\" \u003c\u003e x.item) ref\n          }\n          r\n\n  traverse_ handleResult matched\n\n  actual \u003c- Ref.read ref\n  let\n    expected =\n      [ \"Bill\"\n      , \"12\"\n      , \"24,Apple\"\n      , \"no match: /no/match\"\n      ]\n  assertEqual { actual, expected }\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjustinwoo%2Fpurescript-kushikatsu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjustinwoo%2Fpurescript-kushikatsu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjustinwoo%2Fpurescript-kushikatsu/lists"}