No description
Find a file
2022-05-14 00:34:57 +09:00
.github/workflows mv test.yml 2022-04-12 18:45:16 +02:00
src support nnkTupleConstr ident 2022-05-14 00:34:49 +09:00
tests change some texts... 2022-04-23 16:23:52 +02:00
LICENCE init 2022-04-11 21:47:49 +02:00
README.md Update README.md 2022-05-12 23:25:49 +09:00
resultsutils.nimble version 0.1.7 2022-05-14 00:34:57 +09:00

resultsutils

resultutils to make Result handling easier.

inspired by optionsutils.

Usage

import results, resultsutils

func greet(name: string): Result[string, string] =
  if name.len > 0:
    return ok("hi, " & name)
  return err("No name? 😐")

let hiNim: string = match greet "Nim":
  Ok(greet):
    greet
  Err(_):
    "Oh no! something went wrong 😨"

assert hiNim == "hi, Nim"

more code examples can be found here

Installation

nimble install resultsutils

or add a dependency to your .nimble file:

requires "resultsutils"