What problem does it solve?
Go developers often struggle with nil handling and boilerplate error propagation. This Skill introduces monadic abstractions (Option, Result, Either) to model absence, failure, and alternative choices in a type-safe, composable way, reducing nil-pointer risks and repetitive error checks.
Core Features & Use Cases
- Option for explicit nullable values to prevent nil dereferences and clarify absence in JSON/DB models.
- Result for ergonomic error handling and composable pipelines within Go code.
- Either for representing two valid alternatives, such as cached vs fresh data, without signaling errors.
- Do notation, and pipeline utilities to chain operations with minimal boilerplate.
- Guidance on using sub-packages (option, result, either) for type-changing transforms and pipes.
Quick Start
Install and try a simple monadic flow: import the mo library, create Some/Ok values, and apply a small Map to observe automatic short-circuiting on None/Err.