Closed emanueloliveira23 closed 5 years ago
What version of xtract are you using?
@tmccombs ,
"com.lucidchart" %% "xtract" % "2.0.0"
Ah, yeah. So version 2.0 changed the syntax a little bit, and moved from play-syntax to cats. In version two your example would be:
import com.lucidchart.open.xtract.{XmlReader, __}
import com.lucidchart.open.xtract.XmlReader._
import cats.syntax.all._
case class Foo(a: String, b: Int)
object Foo {
implicit val reader: XmlReader[Foo] = (
(__ \ "a").read[String],
(__ \ "b").read[Int]
).mapN(apply _)
}
See https://github.com/lucidsoftware/xtract/blob/master/CHANGELOG.md
Great! Thank you @tmccombs.
I was following the tutorials and articles on the internet and they show in the old way.
First, thanks for the library. Seems to be amazing.
Issue
I made all imports, including Play's functional package, but the following error appears to compile:
value and is not a member of com.lucidchart.open.xtract.XmlReader[...]
.For example:
Can anyone help me? Do I misunderstand something?
Environment