Skip to content
This repository was archived by the owner on Apr 7, 2025. It is now read-only.
/ resultsutils Public archive

Utility macros for easier handling of Result

License

Notifications You must be signed in to change notification settings

nonnil/resultsutils

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
Apr 12, 2022
May 13, 2022
Apr 23, 2022
Apr 11, 2022
May 12, 2022
May 13, 2022

Repository files navigation

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"

About

Utility macros for easier handling of Result

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages