{"id":16964958,"url":"https://github.com/propensive/serpentine","last_synced_at":"2025-03-22T14:30:59.692Z","repository":{"id":39483132,"uuid":"379227386","full_name":"propensive/serpentine","owner":"propensive","description":"Precise navigation of path structures in Scala","archived":false,"fork":false,"pushed_at":"2025-02-11T23:53:45.000Z","size":3440,"stargazers_count":3,"open_issues_count":2,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-18T11:52:02.461Z","etag":null,"topics":["hierarchy","navigation","paths","relative-path","scala"],"latest_commit_sha":null,"homepage":"https://soundness.dev/serpentine/","language":"Scala","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/propensive.png","metadata":{"files":{"readme":".github/readme.md","changelog":null,"contributing":".github/contributing.md","funding":null,"license":null,"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,"publiccode":null,"codemeta":null}},"created_at":"2021-06-22T10:18:47.000Z","updated_at":"2025-02-11T23:53:48.000Z","dependencies_parsed_at":"2023-02-19T17:00:45.640Z","dependency_job_id":"5a4ab34e-4bc5-4593-8165-6155bd41bdae","html_url":"https://github.com/propensive/serpentine","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/propensive%2Fserpentine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/propensive%2Fserpentine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/propensive%2Fserpentine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/propensive%2Fserpentine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/propensive","download_url":"https://codeload.github.com/propensive/serpentine/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244971769,"owners_count":20540852,"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":["hierarchy","navigation","paths","relative-path","scala"],"created_at":"2024-10-13T23:44:41.486Z","updated_at":"2025-03-22T14:30:59.683Z","avatar_url":"https://github.com/propensive.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"[\u003cimg alt=\"GitHub Workflow\" src=\"https://img.shields.io/github/actions/workflow/status/propensive/serpentine/main.yml?style=for-the-badge\" height=\"24\"\u003e](https://github.com/propensive/serpentine/actions)\n[\u003cimg src=\"https://img.shields.io/discord/633198088311537684?color=8899f7\u0026label=DISCORD\u0026style=for-the-badge\" height=\"24\"\u003e](https://discord.com/invite/MBUrkTgMnA)\n\u003cimg src=\"/doc/images/github.png\" valign=\"middle\"\u003e\n\n# Serpentine\n\n__Precise navigation of paths__\n\n__Serpentine__ is a small library for handling the abstract notion of paths, distinguishing between\nrelative and absolute forms, rooted on some value. This may be useful for representing paths on a\nfilesystem, resources on an HTTP server, descendants in a family tree, or many other concepts which\nfollow a hierarchical pattern.\n\n## Features\n\n- representations of hierarchical paths\n- designed for extension and use in many concrete contexts\n- distinguishes between absolute and relative paths\n\n## Availability\n\n\n\n\n\n\n\n## Getting Started\n\nThe type `Root` defines a \"root\", beneath which any number of possible `Path` instances may exist in\na hierarchy, and the methods `parent`, `ancestor` and `/` may be used to navigate between them. For\nabstract paths, the value `Base` can serve as a root node for a path hierarchy.\n\nHere are some examples:\n```scala\nval crustaceans = Base / \"eukaryota\" / \"animalia\" / \"arthropods\" / \"crustaceans\"\nval arthropods = crustaceans.parent\nval animalia = crustaceans.ancestor(2)\n```\n\n`Path`s may be further distinguished as `Path.Relative` or `Path.Absolute`, where a `Relative` may\nbe converted into an `Absolute` by calling the `Path#absolute` method, and passing an absolute path\nto which the relative path should be considered relative to. The result is typed as `Path.Absolute`.\n\n`Path` objects, whether absolute or relative, serialize with `toString` according to the delimiters\nin their root, which are defined in terms of a base name (for example, `/` or `classpath:`) and a\nseparator (for example, `\\`, `/` or `.`).\n\nAny implementation of `Root` should define these values, `prefix` and `separator`, respectively. For\nexample, the definition,\n```scala\nobject Domain extends Root(prefix = \"\", separator = \".\")\n```\nwould ensure that,\n```scala\nDomain / \"www\" / \"example\" / \"com\"\n```\nwould serialize to the string `\"www.example.com\"`.\n\nNote that the `separator` is not included between the `prefix` and the first path element when\nserializing, so _may_ need to be included in the `prefix` value itself.\n\n### Other Methods\n\nThe method `++` can add a `Relative` path to an `Absolute` path, and return a new `Absolute` path.\n\nSimilarly, `Absolute#relativeTo` takes another `Absolute` path and returns a `Relative` instance\nthat, when applied with `++` to the first path, produces the second path.\n\nThe `Absolute#conjunction` method will find the closest common parent of the path and its parameter.\n\nNote that `Path`s are not aware of their children, so there is no `children` method, but this may be\nprovided by individual implementations.\n\n### Exceptions\n\nMany operations on `Path`s may attempt (directly or indirectly) to access the parent of the root.\nThis is not possible, and if this happens, a `RootBoundaryExceeded` exception will be thrown.\n\n### Generic relative paths\n\nGiven that a relative path is (by definition) not attached to any particular root, all instances of\n`Root#Path.Relative` inherit from `GenericRelative` which gives users the choice, when implementing\nAPIs that accept relative paths, between accepting _any_ kind of relative path (regardless of its\norigin) and accepting just those originating from a particular root.\n\n\n\n\n\n## Status\n\nSerpentine is classified as __fledgling__. For reference, Soundness projects are\ncategorized into one of the following five stability levels:\n\n- _embryonic_: for experimental or demonstrative purposes only, without any guarantees of longevity\n- _fledgling_: of proven utility, seeking contributions, but liable to significant redesigns\n- _maturescent_: major design decisions broady settled, seeking probatory adoption and refinement\n- _dependable_: production-ready, subject to controlled ongoing maintenance and enhancement; tagged as version `1.0.0` or later\n- _adamantine_: proven, reliable and production-ready, with no further breaking changes ever anticipated\n\nProjects at any stability level, even _embryonic_ projects, can still be used,\nas long as caution is taken to avoid a mismatch between the project's stability\nlevel and the required stability and maintainability of your own project.\n\nSerpentine is designed to be _small_. Its entire source code currently consists\nof 413 lines of code.\n\n## Building\n\nSerpentine will ultimately be built by Fury, when it is published. In the\nmeantime, two possibilities are offered, however they are acknowledged to be\nfragile, inadequately tested, and unsuitable for anything more than\nexperimentation. They are provided only for the necessity of providing _some_\nanswer to the question, \"how can I try Serpentine?\".\n\n1. *Copy the sources into your own project*\n   \n   Read the `fury` file in the repository root to understand Serpentine's build\n   structure, dependencies and source location; the file format should be short\n   and quite intuitive. Copy the sources into a source directory in your own\n   project, then repeat (recursively) for each of the dependencies.\n\n   The sources are compiled against the latest nightly release of Scala 3.\n   There should be no problem to compile the project together with all of its\n   dependencies in a single compilation.\n\n2. *Build with [Wrath](https://github.com/propensive/wrath/)*\n\n   Wrath is a bootstrapping script for building Serpentine and other projects in\n   the absence of a fully-featured build tool. It is designed to read the `fury`\n   file in the project directory, and produce a collection of JAR files which can\n   be added to a classpath, by compiling the project and all of its dependencies,\n   including the Scala compiler itself.\n   \n   Download the latest version of\n   [`wrath`](https://github.com/propensive/wrath/releases/latest), make it\n   executable, and add it to your path, for example by copying it to\n   `/usr/local/bin/`.\n\n   Clone this repository inside an empty directory, so that the build can\n   safely make clones of repositories it depends on as _peers_ of `serpentine`.\n   Run `wrath -F` in the repository root. This will download and compile the\n   latest version of Scala, as well as all of Serpentine's dependencies.\n\n   If the build was successful, the compiled JAR files can be found in the\n   `.wrath/dist` directory.\n\n## Contributing\n\nContributors to Serpentine are welcome and encouraged. New contributors may like\nto look for issues marked\n[beginner](https://github.com/propensive/serpentine/labels/beginner).\n\nWe suggest that all contributors read the [Contributing\nGuide](/contributing.md) to make the process of contributing to Serpentine\neasier.\n\nPlease __do not__ contact project maintainers privately with questions unless\nthere is a good reason to keep them private. While it can be tempting to\nrepsond to such questions, private answers cannot be shared with a wider\naudience, and it can result in duplication of effort.\n\n## Author\n\nSerpentine was designed and developed by Jon Pretty, and commercial support and\ntraining on all aspects of Scala 3 is available from [Propensive\nO\u0026Uuml;](https://propensive.com/).\n\n\n\n## Name\n\nA path which is _serpentine_ may be a challenge to navigate, which is where _Serpentine_ can help.\n\nIn general, Soundness project names are always chosen with some rationale,\nhowever it is usually frivolous. Each name is chosen for more for its\n_uniqueness_ and _intrigue_ than its concision or catchiness, and there is no\nbias towards names with positive or \"nice\" meanings—since many of the libraries\nperform some quite unpleasant tasks.\n\nNames should be English words, though many are obscure or archaic, and it\nshould be noted how willingly English adopts foreign words. Names are generally\nof Greek or Latin origin, and have often arrived in English via a romance\nlanguage.\n\n## Logo\n\nThe logo shows a serpentine section of river, meandering.\n\n## License\n\nSerpentine is copyright \u0026copy; 2025 Jon Pretty \u0026 Propensive O\u0026Uuml;, and\nis made available under the [Apache 2.0 License](/license.md).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpropensive%2Fserpentine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpropensive%2Fserpentine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpropensive%2Fserpentine/lists"}