{"id":18865735,"url":"https://github.com/lilactown/cascade","last_synced_at":"2025-10-15T15:16:30.143Z","repository":{"id":38018410,"uuid":"440037793","full_name":"lilactown/cascade","owner":"lilactown","description":"A library of continuation-passing, thunk-producing versions of many Clojure core functions.","archived":false,"fork":false,"pushed_at":"2022-07-31T21:54:57.000Z","size":71,"stargazers_count":74,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-10-13T08:04:16.131Z","etag":null,"topics":["clojure","clojurescript","continuation-passing-style","cps","recursion","walk"],"latest_commit_sha":null,"homepage":"","language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"epl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lilactown.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}},"created_at":"2021-12-20T04:03:36.000Z","updated_at":"2025-10-04T14:11:19.000Z","dependencies_parsed_at":"2022-09-06T07:11:23.916Z","dependency_job_id":null,"html_url":"https://github.com/lilactown/cascade","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/lilactown/cascade","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lilactown%2Fcascade","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lilactown%2Fcascade/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lilactown%2Fcascade/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lilactown%2Fcascade/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lilactown","download_url":"https://codeload.github.com/lilactown/cascade/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lilactown%2Fcascade/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279085926,"owners_count":26100021,"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","status":"online","status_checked_at":"2025-10-15T02:00:07.814Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["clojure","clojurescript","continuation-passing-style","cps","recursion","walk"],"created_at":"2024-11-08T05:04:23.923Z","updated_at":"2025-10-15T15:16:30.124Z","avatar_url":"https://github.com/lilactown.png","language":"Clojure","readme":"# ⛰️ cascade\n\n[![Clojars Project](https://img.shields.io/clojars/v/town.lilac/cascade.svg)](https://clojars.org/town.lilac/cascade)\n[![cljdoc badge](https://cljdoc.org/badge/town.lilac/cascade)](https://cljdoc.org/d/town.lilac/cascade)\n\n\nCascade is a library of continuation-passing, thunk producing versions of many\nClojure core functions.\n\nThe goal is to allow essentially unbounded recursion and mutual recursion of\nseq operations. This means that the seq operations in this library must not\nuse the call stack. Instead, they use a combination of continuation-passing to\nensure that operations can always be in the tail position and trampolining to\nensure that operations do not use the call stack.\n\nThis provides the ability to write recursive algorithms that work on very nested\ndata structures in Clojure(Script) using familiar operations.\n\n## cascade.core\n\n`cascade.core` aims to cover\n- seq operations: reduce, transduce, into, and common transducer-producing fns\n- CPS fn composition: identity, complement, comp\n\nAll seq operations can be passed a continuation as first argument, which will\nbe called on completion of the operation, and returns a thunk (0-arity\nfunction) which can be called to begin the operation. A thunk will return\neither another thunk, which can be called to continue the operation, or the\nresult. Thus, they are meant to be used with `clojure.core/trampoline`.\n\nIf a continuation is not passed in to most seq operations, it is assumed you\nwant to run the operation eagerly and will trampoline for you, returning the\nresult.\n\n### Transducers\n\nTransducer-producing functions like `map`, `filter`, etc. take functions which\naccept a continuation and the element of the sequence they are operating on, and\nshould call the continuation with the result instead of returning it.\n\nWhen passed a single function, they return a transducer for use with\n`cascade.core/transduce` and `cascade.core/into`.\n\nWhen passed a function and a collection, they will eagerly execute the operation\nusing `trampoline` and return the result.\n\nWhen passed a continuation, a function and a collection, they will return a\nthunk, meaning it can be trampolined.\n\n## cascade.hike\n\nWhat is a hike, but a really long walk?\n\n`cascade.hike` is like `clojure.walk`, but defines `walk` in a way that supports\nwalking very large, nested data structures without using the call stack.\n\nDefines recursive tree operations for Clojure data structures. Functions in\nthis namespace take any data structure (list, vector, map, set, seq) and\ntraverses those forms.\n\n`cascade.hike/walk` is a generic tree walker that uses continuation-passing\nand returns thunks. It takes any data structure, calls a function with a\ncontinuation on every element, and uses the value passed into the continuation\nin place of the original. This makes it easier to write recursive search-and-replace\nfunctions for very nested data that do not use the call stack, as shown in the\nrest of the functions in this namespace.\n\n## License\n\nCopyright © 2021 Will Acton. Distributed under the EPL 2.0.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flilactown%2Fcascade","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flilactown%2Fcascade","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flilactown%2Fcascade/lists"}