Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/matttproud/esort
Package esort provides mechanisms for sorting user-defined types according to compound criteria extensibly.
https://github.com/matttproud/esort
Last synced: 21 days ago
JSON representation
Package esort provides mechanisms for sorting user-defined types according to compound criteria extensibly.
- Host: GitHub
- URL: https://github.com/matttproud/esort
- Owner: matttproud
- License: apache-2.0
- Created: 2023-01-27T16:41:45.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-01-29T09:59:50.000Z (almost 2 years ago)
- Last Synced: 2024-06-19T13:47:01.974Z (5 months ago)
- Language: Go
- Size: 17.6 KB
- Stars: 4
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# esort
> Package esort provides mechanisms for sorting user-defined types according
> to compound criteria extensibly. It is mutually compatible with package sort
> from the standard library. The package name comes from the combination of
> the words "extensible" and "sort" and shortened as "esort."## Goals
* Type Safe
* Zero Allocation (in common workflows if sorting basis is known a priori)
* Zero Reflection
* Safe and Accurate
* Reasonable Degree of Ergonomics## Motivation
This is an experimental library.
Stupid as it sounds: during code review out in the field, I have seen more
half-baked `(sort.Interface).Less` implementations than I am comfortable with,
particularly where compound criteria are evaluated. I wondered whether the
situation could be solved through an API.I'm not suggesting anyone should use this. There are potentially other
solutions to improve ergonomics and performance. For the time being, it is a
minimally-viable prototype.Its API documentation is available at https://pkg.go.dev/github.com/matttproud/esort.