https://github.com/janstenpickle/uscala-cats
Cats based extensions for uscala microlib
https://github.com/janstenpickle/uscala-cats
Last synced: about 2 months ago
JSON representation
Cats based extensions for uscala microlib
- Host: GitHub
- URL: https://github.com/janstenpickle/uscala-cats
- Owner: janstenpickle
- License: mit
- Created: 2016-07-12T07:33:15.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-07-13T13:50:43.000Z (almost 10 years ago)
- Last Synced: 2025-01-01T22:43:35.136Z (over 1 year ago)
- Language: Scala
- Size: 3.91 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# [Cats](https://github.com/typelevel/cats) extensions for [uscala](https://github.com/albertpastrana/uscala)
[](https://travis-ci.org/janstenpickle/uscala-cats)
This currently has just one module:
|Name|Description|Download|
|---|---|---|
|**Result** | Provides `ResultsNel` type and a Cats Applicative instance for `Result` | [](https://bintray.com/janstenpickle/maven/uscala-cats-result/_latestVersion) |
## Install with SBT
Add the following to your sbt `project/plugins.sbt` file:
```scala
addSbtPlugin("me.lessis" % "bintray-sbt" % "0.3.0")
```
Then add the following to your `build.sbt`
```scala
resolvers += Resolver.bintrayRepo("janstenpickle", "maven")
libraryDependencies += "uscala-cats" %% "uscala-cats-result" % "0.1.0"
## Usage
This library allows usage of the cats scream operator (`|@|`) on the uscala Result type.
```scala
import cats.std.all._
import cats.syntax.cartesian._
import uscala.cats.result.applicative._
import uscala.cats.syntax.result._
object Example {
val result =
(ResultNel.ok[String, String]("test1") |@|
ResultNel.fail[String, String]("test2") |@|
Result.fail[String, String]("test3").toResultNel).map(_ + _ + _) // = Fail(NonEmptyList("test2", "test3"))
}
```