A Go library for defining intervals and determining their relationships, such as overlaps, meets, and contains.
go-rampart is a Go library for defining intervals and determining their relationships, such as overlaps, meets, and contains. It solves the problem of analyzing how intervals relate to each other, which is useful for time-based event checking or overlapping range detection. The library supports any ordered type or custom types via comparison functions.
Go developers working with intervals, time frames, or range-based logic, such as in scheduling systems, data analysis, or event processing applications.
Developers choose go-rampart for its precise interval relation detection, flexibility with custom types, and clean port of proven Haskell interval logic to Go, offering a reliable and type-safe solution.
Determine how intervals relate to each other.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Faithfully ports Haskell Rampart's interval algebra, providing accurate relation detection like overlaps and meets, as demonstrated in the examples with ordered types.
Works with any ordered type or custom types via comparison functions, shown with time.Time where a custom compareTimes function is required.
Offers simple functions such as NewInterval and Relate, making interval definition and comparison straightforward, leveraging Go's generics for type safety.
README includes installation steps, code examples, and badges for testing and coverage, indicating active development and reliability.
Requires users to write comparison functions for non-ordered types like time.Time, adding extra code and potential for errors, as seen in the example.
Focuses only on interval relations; lacks built-in operations for interval arithmetic, set operations, or utilities like merging intervals.
Relies on Go's generics feature, which may not be compatible with older Go versions or projects avoiding generics due to complexity or compatibility concerns.