{"id":15010659,"url":"https://github.com/bsless/adashot","last_synced_at":"2026-03-27T04:53:46.769Z","repository":{"id":62431245,"uuid":"252488003","full_name":"bsless/Adashot","owner":"bsless","description":"A lenses library in Clojure with reasonable performance","archived":false,"fork":false,"pushed_at":"2020-04-04T14:54:34.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-08T19:34:36.780Z","etag":null,"topics":["clojure","lenses","performance"],"latest_commit_sha":null,"homepage":null,"language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bsless.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":"2020-04-02T15:04:52.000Z","updated_at":"2020-04-04T14:54:36.000Z","dependencies_parsed_at":"2022-11-01T21:00:30.843Z","dependency_job_id":null,"html_url":"https://github.com/bsless/Adashot","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/bsless%2FAdashot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bsless%2FAdashot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bsless%2FAdashot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bsless%2FAdashot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bsless","download_url":"https://codeload.github.com/bsless/Adashot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243292188,"owners_count":20268036,"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","lenses","performance"],"created_at":"2024-09-24T19:35:14.621Z","updated_at":"2025-12-29T01:42:58.059Z","avatar_url":"https://github.com/bsless.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Adashot\n\nA lenses library in Clojure.\n\n## Why\n\nSometimes you find yourself doing plenty of `get-in`s, `update-in`s or\n`assoc-in`s, and you happen to care about performance.\n\nIf you know the keys in advance everything is good and you can use\n[clj-fast](https://github.com/bsless/clj-fast). But what happens if you\ndon't, but the keys which you'll work with rarely change?\n\nIf you knew the keys, that's usually where you'll create the `fn` object\nin advance and cache it. But figuring out how many keys you need to work\nwith isn't so expensive, and the added benefit of faster calculations\noffsets the one time cost of analyzing the keys.\n\nThis is where lenses come in. Lenses are objects which satisfy a simple interface:\n\n| lens interface | Clojure equivalent |\n| :-:            | :-:                |\n| view           | get-in             |\n| put            | assoc-in           |\n| over           | update-in          |\n\nSince the library is built on top of clj-fast, these perform well enough\nto justify caching over walking over keys dynamically.\n\n## Usage\n\n### Require Adashot\n\n```clojure\n(require '[adashot.core :as a])\n```\nor\n```clojure\n(ns my-ns\n  (:require [adashot.core :as a]))\n```\n\n### Create a lens\n\n```clojure\n(def ks [:a :b])\n(def lens (a/keys-\u003efast-lens ks))\n```\n\n### Use a lens\n\n```clojure\n(def m {:a {:b 1}})\n(a/view lens m)\n(a/put lens m 2)\n(a/over lens m + 2 3)\n```\n\n## License\n\nCopyright © 2020 Ben Sless\n\nThis program and the accompanying materials are made available under the\nterms of the Eclipse Public License 2.0 which is available at\nhttp://www.eclipse.org/legal/epl-2.0.\n\nThis Source Code may also be made available under the following Secondary\nLicenses when the conditions for such availability set forth in the Eclipse\nPublic License, v. 2.0 are satisfied: GNU General Public License as published by\nthe Free Software Foundation, either version 2 of the License, or (at your\noption) any later version, with the GNU Classpath Exception which is available\nat https://www.gnu.org/software/classpath/license.html.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbsless%2Fadashot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbsless%2Fadashot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbsless%2Fadashot/lists"}