Results.jl

Result types and combinators in Julia
Author hexane360
Popularity
3 Stars
Updated Last
1 Year Ago
Started In
August 2020

Results.jl: Fallable computation for Julia

Results.jl provides a Result and Option type for computation, as featured in Rust, Haskell (as Either), OCaml, and many more.

This library is distributed under the LGPL v3.0 license.

About

The core Result type is simply an alias for Union{Ok{T}, Err{E}}, allowing you to dispatch on Ok and Err variants separately. The Option type is defined as Union{Base.Some{T}, Base.Nothing}, allowing for easy compatibility with other libraries.

Why?

Results.jl attempts to provide a compromise between strict type-safety and maximum ergonomics. Compared to exceptions, Results.jl is faster. Compared with a bare nullable type Union{T, Nothing}, Results.jl is more correct. And compared to other libraries, Results.jl aims to be more complete and more ergonomic.

Documentation

Check out the documentation on JuliaHub.


Pull requests and issues are welcome. This is my first Julia package, so I'm expecting some criticism.