Skip to content

Commit 7532374

Browse files
haskiindahouseMikhail Murunov
andauthored
update readme (#413)
Co-authored-by: Mikhail Murunov <m.murunov@tinkoff.ru>
1 parent 7bb6a8e commit 7532374

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ If a library has support for `derevo`, you can simply write
1414
@derive(SomeCaseClass, AnotherCaseClass, fooDerivation, barDerivation(param1, param2))
1515
case class Foo(...)
1616
```
17-
where `SomeCaseClass`, `AnotherCaseClass`, `fooDerivation`, `barDerivation` are some objects, extending one of the `InstanceDef` traits ([see module source](https://github.com/tofu-tf/derevo/blob/supertagged/core/src/main/scala/derevo/package.scala#L13:L21)).
17+
where `SomeCaseClass`, `AnotherCaseClass`, `fooDerivation`, `barDerivation` are some objects, extending one of the `InstanceDef` traits ([see module source](https://github.com/tofu-tf/derevo/blob/master/modules/core/src/main/scala/derevo/package.scala#L20:L29)).
1818

1919
For every element of the `@derive` macro, there will be generated `implicit val` or `implicit def` (when `Foo` has type parameters) providing the corresponding typeclass.
2020
For simple type derivation, if `Foo` has type parameters, the instance will require an instance of the same or specified other typeclass for proper derivation.
@@ -34,7 +34,7 @@ If you have problems with the initialization order you can optionally put the
3434

3535

3636
## Making your own derivation.
37-
First, extend the object (the companion object for your type is the best option) from one of the [`InstanceDef` traits](https://github.com/tofu-tf/derevo/blob/supertagged/core/src/main/scala/derevo/package.scala#L13:L21).
37+
First, extend the object (the companion object for your type is the best option) from one of the [`InstanceDef` traits](https://github.com/tofu-tf/derevo/blob/master/modules/core/src/main/scala/derevo/package.scala#L20:L29).
3838

3939
Then implement the `instance` method for your object so it could derive the corresponding instance.
4040
Example:
@@ -51,7 +51,7 @@ object TypeClass extends Derivaton[TypeClass] {
5151
Also, you can define additional methods `def apply(...)` or `def foo(...)` in your derivation object. This will allow instance creation as
5252
`@derive(TypeClass(...))` or `@derive(TypeClass.foo(...))`.
5353

54-
To support `newtype` derivation, extend your object with (`NewtypeDerivation`)[https://github.com/tofu-tf/derevo/blob/master/core/src/main/scala/derevo/NewTypeRepr.scala#L8]. Alternatively, your object may have the `newtype[R]` method with a single type parameter that receives the underlying type and returns another object that has the `instance` method that works as described earlier.
54+
To support `newtype` derivation, extend your object with [`NewtypeDerivation` trait](https://github.com/tofu-tf/derevo/blob/master/modules/core/src/main/scala/derevo/NewTypeRepr.scala#L8). Alternatively, your object may have the `newtype[R]` method with a single type parameter that receives the underlying type and returns another object that has the `instance` method that works as described earlier.
5555

5656
Sometimes, the required constraint may differ from the provided typeclass, e.g. `circe.Encoder` which requires
5757
`Encoder` for each field but provides `Encoder.AsObject` for the target case class.
@@ -80,7 +80,7 @@ This works by adding the `@delegating` annotation to your delegator object:
8080
@delegating("full.qualified.method.path")
8181
```
8282
Then call `macro Derevo.delegate`, `macro Derevo.delegateParams`, `macro Derevo.delegateParams2` or `macro Derevo.delegateParams3` in the corresponding methods.
83-
An example can be found [here](https://github.com/tofu-tf/derevo/blob/supertagged/circe/src/main/scala/derevo/circe/circe.scala).
83+
An example can be found [here](https://github.com/tofu-tf/derevo/blob/master/modules/circe/src/main/scala/derevo/circe/circe.scala).
8484

8585

8686
## Installation

0 commit comments

Comments
 (0)