title: Cats Validated with mapN
body: <p>I'm a beginner with Cats.
  I have an error with Validated cats. I use a list accumulator like that :</p>
  
  <pre><code>case class Type(
   name: String,
   pattern: String,
   primitiveType: PrimitiveType = PrimitiveType.string,
   sample: Option[String] = None,
   comment: Option[String] = None,
   stat: Option[Stat] = None
  ) {
   type ValidationResult[A] = Validated[List[String], A]
  
   def checkValidity(): ValidationResult[Boolean] = {
    val errorList: mutable.MutableList[String] = mutable.MutableList.empty
  
    val patternIsValid = Try {
     primitiveType match {
      case PrimitiveType.struct =&gt;
      case PrimitiveType.date =&gt;
        new SimpleDateFormat(pattern)
      case PrimitiveType.timestamp =&gt;
        pattern match {
          case "epoch_second" | "epoch_milli" =&gt;
          case _ if PrimitiveType.formatters.keys.toList.contains(pattern) =&gt;
          case _ =&gt;
            DateTimeFormatter.ofPattern(pattern)
        }
      case _ =&gt;
        Pattern.compile(pattern)
     }
   }
   if (patternIsValid.isFailure)
    errorList += s"Invalid Pattern $pattern in type $name"
   val ok = sample.forall(this.matches)
   if (!ok)
    errorList += s"Sample $sample does not match pattern $pattern in type $name"
   if (errorList.nonEmpty)
    Invalid(errorList.toList)
   else
    Valid(true)
  }
  }
  </code></pre>
  
  <p>When I use this function with my case class Types :</p>
  
  <pre><code>case class Types(types: List[Type]) {
  
   type ValidationResult[A] = Validated[List[String], A]
  
   def checkValidity(): ValidationResult[Boolean] = {
     val typeNames = types.map(_.name)
     val dup: ValidationResult[Boolean] =
     duplicates(typeNames, s"%s is defined %d times. A type can only be defined once.")
    (dup,types.map(_.checkValidity()).sequence).mapN((_,_) =&gt; true)
   }
  }
  </code></pre>
  
  <p>I have this error </p>
  
  <pre><code>Error:(29, 39) Cannot prove that cats.data.Validated[List[String],Boolean] &lt;:&lt; G[A].
  (dup,types.map(_.checkValidity()).sequence: _*).mapN((_,_) =&gt; true)
  </code></pre>
  
  <p>Can you help me to resolve this error?</p>
  
  <p>Thanks for your help.</p>