Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zio/interop-scalaz
https://github.com/zio/interop-scalaz
interoperability scala scalaz
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/zio/interop-scalaz
- Owner: zio
- License: apache-2.0
- Created: 2019-06-09T15:52:45.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-04-09T02:47:32.000Z (9 months ago)
- Last Synced: 2024-04-23T05:29:22.595Z (8 months ago)
- Topics: interoperability, scala, scalaz
- Language: Scala
- Homepage: https://zio.dev/zio-interop-scalaz
- Size: 133 KB
- Stars: 7
- Watchers: 6
- Forks: 8
- Open Issues: 27
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
[//]: # (This file was autogenerated using `zio-sbt-website` plugin via `sbt generateReadme` command.)
[//]: # (So please do not edit it manually. Instead, change "docs/index.md" file or sbt setting keys)
[//]: # (e.g. "readmeDocumentation" and "readmeSupport".)# ZIO Interop Scalaz
This library provides instances for several Scalaz typeclasses.
[![Development](https://img.shields.io/badge/Project%20Stage-Development-green.svg)](https://github.com/zio/zio/wiki/Project-Stages) ![CI Badge](https://github.com/zio/interop-scalaz/workflows/CI/badge.svg) [![Sonatype Releases](https://img.shields.io/nexus/r/https/oss.sonatype.org/dev.zio/zio-interop-scalaz7x_2.13.svg?label=Sonatype%20Release)](https://oss.sonatype.org/content/repositories/releases/dev/zio/zio-interop-scalaz7x_2.13/) [![Sonatype Snapshots](https://img.shields.io/nexus/s/https/oss.sonatype.org/dev.zio/zio-interop-scalaz7x_2.13.svg?label=Sonatype%20Snapshot)](https://oss.sonatype.org/content/repositories/snapshots/dev/zio/zio-interop-scalaz7x_2.13/) [![javadoc](https://javadoc.io/badge2/dev.zio/zio-interop-docs_2.13/javadoc.svg)](https://javadoc.io/doc/dev.zio/zio-interop-docs_2.13) [![ZIO Interop Scalaz](https://img.shields.io/github/stars/zio/interop-scalaz?style=social)](https://github.com/zio/interop-scalaz)
## Installation
In order to use this library, we need to add the following line in our `build.sbt` file:
```scala
libraryDependencies += "dev.zio" %% "zio-interop-scalaz" % "7.3.3.0"
```## Example 1
```scala
import scalaz._, Scalaz._
import zio.interop.scalaz._type Database = IList[User]
def findUser(id: UserId): ZIO[Database, UserError, User] = ...
def findUsers(ids: IList[UserId]): ZIO[Database, UserError, IList[User]] = ids.traverse(findUser(_))
```## `ZIO` parallel `Applicative` instance
Due to `Applicative` and `Monad` coherence law `ZIO`'s `Applicative` instance has to be implemented in terms of `bind` hence when composing multiple effects using `Applicative` they will be sequenced. To cope with that limitation `ZIO` tagged with `Parallel` has an `Applicative` instance which is not `Monad` and operates in parallel.
## Example 2
```scala
import scalaz._, Scalaz._
import zio.interop.scalaz._case class Dashboard(details: UserDetails, history: TransactionHistory)
def getDetails(id: UserId): ZIO[Database, UserError, UserDetails] = ...
def getHistory(id: UserId): ZIO[Database, UserError, TransactionHistory] = ...def buildDashboard(id: UserId): ZIO[Database, UserError, Dashboard] =
Tag.unwrap(^(par(getDetails(id)), par(getHistory(id)))(Dashboard.apply))def par[R, E, A](io: ZIO[R, E, A]): ParIO[R, E, A] = Tag(io)
```## Documentation
Learn more on the [ZIO Interop Scalaz homepage](https://zio.dev/zio-interop-scalaz)!
## Contributing
For the general guidelines, see ZIO [contributor's guide](https://zio.dev/about/contributing).
## Code of Conduct
See the [Code of Conduct](https://zio.dev/about/code-of-conduct)
## Support
Come chat with us on [![Badge-Discord]][Link-Discord].
[Badge-Discord]: https://img.shields.io/discord/629491597070827530?logo=discord "chat on discord"
[Link-Discord]: https://discord.gg/2ccFBr4 "Discord"## License
[License](LICENSE)