Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename cats.eq to cats.eqv #226

Merged
merged 1 commit into from
Feb 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ implicit def encoder$macro$1[A, B: Encoder]: Encoder.AsObject[Foo[A, B]] = ...

`Foo` can also be a newtype in form of [estatico](https://github.com/estatico/scala-newtype) or [supertagged](https://github.com/rudogma/scala-supertagged) libraries.

If you have problems with the initialization order you can optionally put the
If you have problems with the initialization order you can optionally put the
`insertInstancesHere()` call to the body of your companion object to specify the place where `implicit val`s should be inserted.


Expand Down Expand Up @@ -64,11 +64,11 @@ In this case you should extend `SpecificDerivation` instead, like `object foo ex

## Expression table

| Derivation line | Translation |
| Derivation line | Translation |
|-----------------------------------------------------------|------------------------------------------------------------|
| `@derive(...foo, ...)` | `implicit val foo$macro: Foo[A] = foo.instance` |
| `@derive(...foo(bar))` | `implicit val foo$macro : Foo[A] = foo(bar)` |
| `@derive(...foo.quux(bar))` | `implicit val foo$macro : Foo[A] = foo.quux(bar)` |
| `@derive(...foo(bar))` | `implicit val foo$macro : Foo[A] = foo(bar)` |
| `@derive(...foo.quux(bar))` | `implicit val foo$macro : Foo[A] = foo.quux(bar)` |
| `@derive(...foo, ...)` when `A` is a newtype over `B` | `implicit val foo$macro: Foo[A] = foo.newtype[B].instance` |


Expand All @@ -78,7 +78,7 @@ In this case you should extend `SpecificDerivation` instead, like `object foo ex
This works by adding the `@delegating` annotation to your delegator object:
```scala
@delegating("full.qualified.method.path")
```
```
Then call `macro Derevo.delegate`, `macro Derevo.delegateParams`, `macro Derevo.delegateParams2` or `macro Derevo.delegateParams3` in the corresponding methods.
An example can be found [here](https://github.com/tofu-tf/derevo/blob/supertagged/circe/src/main/scala/derevo/circe/circe.scala).

Expand Down Expand Up @@ -109,7 +109,7 @@ libraryDependencies += "org.manatki" %% "derevo-cats" % "latest version in badge

```scala
import derevo.derive
import derevo.cats.{eq => eqv, show, order, monoid}
import derevo.cats.{eqv, show, order, monoid}

import cats.Monoid
import cats.instances.string._
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import magnolia.{CaseClass, Magnolia, SealedTrait}
import derevo.Derivation
import derevo.NewTypeDerivation

object eq extends Derivation[Eq] with NewTypeDerivation[Eq] {
object eqv extends Derivation[Eq] with NewTypeDerivation[Eq] {
type Typeclass[T] = Eq[T]

def combine[T](ctx: CaseClass[Eq, T]): Eq[T] = new Eq[T] {
Expand Down
2 changes: 1 addition & 1 deletion cats/src/test/scala/derevo/cats/EqSpec.scala
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package derevo.cats

import cats.Eq
import derevo.cats.{eq => eqv}
import derevo.cats._
import derevo.derive
import org.scalatest.freespec.AnyFreeSpec
import io.estatico.newtype.macros.newtype
Expand Down