{"id":15679525,"url":"https://github.com/borkdude/finitize","last_synced_at":"2025-05-07T10:03:42.550Z","repository":{"id":142283284,"uuid":"173975901","full_name":"borkdude/finitize","owner":"borkdude","description":"Limit and realize possibly infinite seqs","archived":false,"fork":false,"pushed_at":"2019-03-08T15:43:24.000Z","size":12,"stargazers_count":12,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-31T08:51:14.629Z","etag":null,"topics":["clojure","clojurescript"],"latest_commit_sha":null,"homepage":"","language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"epl-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/borkdude.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,"governance":null,"roadmap":null,"authors":null,"dei":null},"funding":{"github":"borkdude"}},"created_at":"2019-03-05T15:51:19.000Z","updated_at":"2021-07-11T09:02:18.000Z","dependencies_parsed_at":"2024-02-10T22:36:18.858Z","dependency_job_id":null,"html_url":"https://github.com/borkdude/finitize","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/borkdude%2Ffinitize","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/borkdude%2Ffinitize/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/borkdude%2Ffinitize/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/borkdude%2Ffinitize/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/borkdude","download_url":"https://codeload.github.com/borkdude/finitize/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252856550,"owners_count":21814858,"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":["clojure","clojurescript"],"created_at":"2024-10-03T16:32:35.357Z","updated_at":"2025-05-07T10:03:42.482Z","avatar_url":"https://github.com/borkdude.png","language":"Clojure","funding_links":["https://github.com/sponsors/borkdude"],"categories":[],"sub_categories":[],"readme":"# finitize\n[![Clojars Project](https://img.shields.io/clojars/v/finitize.svg)](https://clojars.org/finitize)\n\nLimit and realize possibly infinite seqs\n\n## Rationale\n\nSometimes I want to force evaluation of some data but not wait forever.\n\nThis library is used in [re-find](https://re-find.it) to not crash the browser\nwhen a user types something like `(map inc (range))`. It's also used when\nrunning examples from [ClojureDocs](https://clojuredocs.org) to verify\n[speculative](https://github.com/borkdude/speculative) specs.\n\n## Usage\n\n``` clojure\n$ clj\nClojure 1.10.0\nuser=\u003e (require '[finitize.core :refer [finitize]])\nnil\n\n;; by default 100 elements are realized and taken\nuser=\u003e (finitize (map inc (range)))\n(1 2 3 4 5 6 7 8 9 10 11 ...)\n\n;; this is customizable by providing an additional argument:\nuser=\u003e (finitize (map inc (range)) 10)\n(1 2 3 4 5 6 7 8 9 10)\n\n;; calling `finitize` on something which is not a seq-like data structure will just return the thing:\nuser=\u003e (finitize 1)\n1\n;; so it's safe to call it on anything\n```\n\n## Extend\n\nCurrently unsupported types can implement the `Finitize` protocol:\n\n``` clojure\nuser=\u003e (require '[finitize.core :refer [finitize Finitize]])\nnil\nuser=\u003e (extend-type String Finitize (finitize ([this] (finitize this 100)) ([this n] (subs this 0 n))))\nnil\nuser=\u003e (finitize \"hello\" 2)\n\"he\"\n```\n\n## Tests\n\n``` clojure\n$ clj -A:test:clj-test-runner\n\nRunning tests in #{\"test\"}\n\nTesting finitize.core-test\n\nRan 1 tests containing 6 assertions.\n0 failures, 0 errors.\n\n$ clj -A:test:cljs-test-runner\n\nTesting finitize.core-test\n\nRan 1 tests containing 6 assertions.\n0 failures, 0 errors.\n\n```\n\n## License\n\nCopyright © 2019 Michiel Borkent\n\nDistributed under the EPL License, same as Clojure. See LICENSE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fborkdude%2Ffinitize","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fborkdude%2Ffinitize","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fborkdude%2Ffinitize/lists"}