{"id":13800867,"url":"https://github.com/llasram/hier-set","last_synced_at":"2025-03-21T19:32:02.056Z","repository":{"id":2870650,"uuid":"3876274","full_name":"llasram/hier-set","owner":"llasram","description":"A Clojure hierarchical set.","archived":false,"fork":false,"pushed_at":"2020-09-24T12:03:36.000Z","size":140,"stargazers_count":7,"open_issues_count":2,"forks_count":7,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-01T07:42:34.898Z","etag":null,"topics":[],"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/llasram.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":"2012-03-30T12:17:48.000Z","updated_at":"2021-11-26T14:55:16.000Z","dependencies_parsed_at":"2022-08-31T03:41:17.080Z","dependency_job_id":null,"html_url":"https://github.com/llasram/hier-set","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/llasram%2Fhier-set","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/llasram%2Fhier-set/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/llasram%2Fhier-set/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/llasram%2Fhier-set/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/llasram","download_url":"https://codeload.github.com/llasram/hier-set/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244153625,"owners_count":20407012,"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":[],"created_at":"2024-08-04T00:01:17.107Z","updated_at":"2025-03-21T19:32:01.688Z","avatar_url":"https://github.com/llasram.png","language":"Clojure","funding_links":[],"categories":["Advanced datastructures"],"sub_categories":[],"readme":"# hier-set\n\nLibrary providing a \"hierarchical set\" data structure.  The provided data\nstructure is set of elements with a defined hierarchical relationship.  An\nelement is considered to be in the set either if it is provided as a primary\nset member or if it is a descendant of any such element.  Lookup in the set not\nonly determines set membership, but also finds all primary set members which\nare ancestors of the lookup element.\n\nThe hierarchical relationship is defined by the element sort-order and a\nseparate containment predicate, with the following constraints:\n\n* elements must sort prior to any descendants; and\n* elements must contain all elements which sort between themselves and any\n  descendant.\n\nThis is sufficient to represent simple hierarchical systems where the hierarchy\nis implicit in the entities involved, such as the Java package system,\nhierarchical filesystems, or IP networks.  It is inappropriate for modeling\ncomplex, ad hoc hierarchies, such as the relationships between classes with\nmultiple inheritance.\n\n## Usage\n\nAdd `hier-set` to the `:dependencies` list in your\n[Leiningen](https://github.com/technomancy/leiningen) `project.clj`:\n\n```clj\n[hier-set \"1.1.2\"]\n```\n\nPrimary usage is then through the `hier-set` and `hier-set-by` constructor\nfunctions in the `hier-set.core` namespace.  In addition to set lookup as\ndescribed above, the `hier-set.core/ancestors` and `hier-set.core/descendants`\nfunctions also provide access to lazy sequences of the ancestors and\ndescendants respectively of a provided key.\n\n## Example\n\nA trivial example:\n\n```clj\n(ns example.hier-set\n  (:require [hier-set.core :as hs])\n  (:use [hier-set.core :only [hier-set]])\n\n(def with-starts? #(.startsWith %2 %1))\n\n(def hs (hier-set with-starts? \"ack\" \"foo\" \"foo.bar\" \"quux\")\n\n(get hs \"bar\")              ;;=\u003e nil\n(get hs \"foo\")              ;;=\u003e (\"foo\")\n(get hs \"foo.bar.baz\")      ;;=\u003e (\"foo.bar\" \"foo\")\n(hs/ancestors hs \"bar\")     ;;=\u003e ()\n(hs/ancestors hs \"foo.baz\") ;;=\u003e (\"foo\")\n(hs/descendants hs \"foo\")   ;;=\u003e (\"foo\" \"foo.bar\")\n```\n\n## License\n\nCopyright © 2012, 2014 Marshall Bockrath-Vandegrift.\n\nDistributed under the Eclipse Public License either version 1.0 or (at\nyour option) any later version.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fllasram%2Fhier-set","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fllasram%2Fhier-set","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fllasram%2Fhier-set/lists"}