Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/hexaredecimal/result.odin

Result<T, E> in odin :)
https://github.com/hexaredecimal/result.odin

Last synced: 9 days ago
JSON representation

Result<T, E> in odin :)

Awesome Lists containing this project

README

        

# Result for odin lang

### Why
>> To avoid the nil check by any means necessary

>> For fun

## Example
```odin
import rs "result"

safe_div :: proc(x: i32, y: i32) -> rs.Result(i32, string) {
if y == 0 do return rs.Err(string){"Divide by zero"}
return rs.Ok(i32){x / y}
}
```