Skip to content

Commit

Permalink
Add a note for older scala versions and custom codecs.
Browse files Browse the repository at this point in the history
  • Loading branch information
jan0sch authored and travisbrown committed Jan 8, 2019
1 parent dcbbc48 commit 885428b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions docs/src/main/tut/codecs/custom-codecs.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ implicit val decodeInstant: Decoder[Instant] = Decoder.decodeString.emap { str =
}
```

#### Older scala versions

If you are using custom codecs and an older versions of scala (below 2.12) and you get errors like
this `value flatMap is not a member of io.circe.Decoder.Result[Option[String]]` or
`value map is not a member of io.circe.Decoder.Result[Option[String]]` then you need to use the
following import: `import cats.syntax.either._` to fix this.

### Custom key types

If you need to encode/decode `Map[K, V]` where `K` is not `String` (or `Symbol`, `Int`, `Long`, etc.),
Expand Down

0 comments on commit 885428b

Please sign in to comment.