I am trying to create an instance of Either
using asRight
in REPL:
import cats._
import cats.data._
import cats.implicits._
scala> val x = "xxx".asRight
<console>:20: error: value asRight is not a member of String
val x = "xxx".asRight
^
scala> import cats.syntax.either._
import cats.syntax.either._
scala> val x = "xxx".asRight
<console>:23: error: value asRight is not a member of String
val x = "xxx".asRight
^
What's wrong with the code above ? Is it possible to use asRight
in REPL ?