@hackage monad-rail0.1.0.0

Railway-oriented error handling for Haskell

  • Installation

  • Dependencies (4)

  • Dependents (0)

Monad.Rail is a Haskell library for Railway-Oriented Programming (ROP), a functional approach to error handling that makes error paths explicit and composable.

The library provides:

  • RailT - A monad transformer for building reliable applications

  • Type-safe error handling with support for error accumulation

  • Automatic JSON serialization of errors for logging and monitoring

  • The <!> operator for combining validations while collecting all errors

  • Integration with any error type implementing HasErrorInfo

Railway-Oriented Programming separates success and failure paths, making it easy to handle both cases explicitly. The <!> operator is particularly useful for validation scenarios where you want to report all validation errors at once rather than stopping at the first failure.

For more information and examples, see the documentation for Monad.Rail.