lampepfl / lampepfl/steps

Result with Exceptions

Open
#21 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Scala
Stars
15
Forks
3
PR merge metrics
No merged PRs in 30d

Description

Hello, would you consider restricting Result[+T, +E] to Result[+T, +E <: Exception]?
If something is a result, the Err case should communicate some information about what went wrong. And Exceptions are the way to do that in Scala: Exceptions can be chained with causality relation and also contain stack traces. Plus have other advantages, like interop with Java and related tooling and can be (re)thrown and caught.

Generally speaking, using Exception for things like Result is the best practice within the wider software engineering Scala world, so it would be nice if steps/Result nudged its users in the right direction.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the Result type in the steps library and read the issue discussion about constraining its error type. Assess the API and compatibility implications of requiring Exception, then verify that the resulting type behavior matches the requested restriction and that the library still compiles.

Written by the indexing model from the issue text.

Assessment

Tech stack
scala
Domain
backend-api-design
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.