https://github.com/sixpounder/pigeon
Java library of types for never-throw oriented programming
https://github.com/sixpounder/pigeon
java never-throw utility
Last synced: 2 months ago
JSON representation
Java library of types for never-throw oriented programming
- Host: GitHub
- URL: https://github.com/sixpounder/pigeon
- Owner: sixpounder
- License: gpl-3.0
- Created: 2024-09-09T00:20:12.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-12-11T00:50:34.000Z (over 1 year ago)
- Last Synced: 2024-12-11T01:18:56.599Z (over 1 year ago)
- Topics: java, never-throw, utility
- Language: Java
- Homepage:
- Size: 105 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Pigeon
**Pigeon** is a Java library that provides a safer, exception-free approach to error handling. It leverages *never-throw* oriented types, such as `Result` and `Option`, to manage success and failure explicitly, inspired by functional programming paradigms. With Pigeon, errors are no longer hidden behind exceptions, promoting cleaner, more maintainable code by making error handling a core part of the type system.
## Features
- **Never-throw philosophy:** Avoids traditional exception handling in favor of `Result` and `Option` types, ensuring all outcomes are explicitly handled.
- **Core types:**
- `Result`: Represents an operation's success (`Ok`) or failure (`Err`).
- `Option`: Encapsulates a value (`Some`) or the absence of one (`None`).
- **Utility types**:
- `Metadata`: Decorates a type with metadata
- **Chainable API:** Methods are designed to be easily composed and chained, leading to concise and expressive code.
- **Explicit error handling:** Prevents silent failures and ensures all potential errors are addressed at compile time.
- **Functional approach:** Aligns with functional programming practices, encouraging pure functions and immutability.
## Installation
To use Pigeon in your project, add the following dependency to your `pom.xml` (for Maven):
```xml
org.storynode
pigeon
0.1.0
```