You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems like this project is all about adding cats type classes to play json types. Would it make sense to also add Reads and Writes to cats data types in here? For example, NonEmptyList?
For example:
implicitdefnonEmptyListReads[A:Reads]:Reads[NonEmptyList[A]] =Reads {
caseJsArray(values) =>
values.toList match {
case head :: tail =>NonEmptyList(head, tail).traverse(_.validate[A])
caseNil=>JsError("Expected a NonEmptyList but got an empty list")
}
case other =>JsError(s"expected an array but got $other")
}
The text was updated successfully, but these errors were encountered:
It seems like this project is all about adding cats type classes to play json types. Would it make sense to also add
Reads
andWrites
to cats data types in here? For example,NonEmptyList
?For example:
The text was updated successfully, but these errors were encountered: