Here is a simple example that is not compiled:
import cats.data.Validated
object Ex {
type FailSlow[A] = Validated[List[String], A]
case class User(name: String, age: Int)
//this works fine:
def validBoth(name:String, age:Int):FailSlow[User] =
Validated.valid[List[String], User](User(name,age))
//this not working:
def validBothNotWorking(name:String, age:Int):FailSlow[User] =
Validated.valid[FailSlow[User]](User(name,age))
}
It seems I miss something with type aliases. Why in the 1st case it works and in the 2nd case it does not.