exercism / exercism/configlet

refactor: consider using `Result` type

Open
#698 0 comments 0 reactions 0 assignees View on GitHub
kind: refactor
Dominant language
Nim
Stars
23
Forks
17
Avg merge
13h 57m
Merged PRs (30d)
1

Description

Pros: can enforce that every error is handled, and see that at the callsite
Cons: may not worth the added noise, and can make exceptions visible with just `{.raises: [FooError].}`

Links:

- https://github.com/arnetheduck/nim-result/
- https://github.com/status-im/nim-stew/blob/f2e58ba4c8da65548c824e4fa8732db9739f6505/stew/results.nim
- https://github.com/status-im/questionable
- https://status-im.github.io/nim-style-guide/errors.html
- https://forum.nim-lang.org/t/8759#57086
- https://joeduffyblog.com/2016/02/07/the-error-model/

Other languages:

- Rust: https://doc.rust-lang.org/std/result/enum.Result.html
- Haskell: https://hackage.haskell.org/package/base-4.17.0.0/docs/Data-Either.html
- C++: https://github.com/ned14/outcome
- C++: https://google.github.io/styleguide/cppguide.html#Exceptions
- Swift: https://docs.swift.org/swift-book/LanguageGuide/ErrorHandling.html

Related:

- https://github.com/exercism/configlet/issues/123
- https://github.com/exercism/configlet/issues/365

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.