Rust style Result
type for Scala
In the opinion of the author Either
and Try
are inferior to the semantic benefits of a dedicated Result
type.
Unfortunately, prior discussions regarding the addition of a Result
type to the standard library have not borne fruit.
Pre-SIP: Rust-like "Result" Proposal
So we'll have to go a with an unofficial solution.
Add the following line to the build.sbt
files:
libraryDependencies += "dev.jsbrucker" %% "result-core" % "1.0.0"
Add "dev.jsbrucker:result-core_2_13:1.0.0"
to the list of artifacts.
<dependency>
<groupId>dev.jsbrucker</groupId>
<artifactId>result-core_2.13</artifactId>
<version>1.0.0</version>
</dependency>