title: Scalaz Validation with applicative functor |@| not working
body: <p>I'm trying to use Scalaz 7 Validation in my app. However, I'm having an issue getting the <code>|@|</code> applicative functor to coalesce my failures.  Here's the code I have:</p>
  
  <pre><code>type ValidationResult = ValidationNel[String, Unit]
  
  def validate[A: ClassTag](instance: A, fieldNames: Option[Seq[String]] = None): ValidationResult = {
      val fields = classTag[A].runtimeClass.getDeclaredFields
      val fieldSubset = fieldNames match {
          case Some(names) =&gt; fields.filter { field =&gt; names.contains(field.getName) }
          case None =&gt; fields
      }
      fieldSubset.map {
          field =&gt; field.getAnnotations.toSeq.map {
              field.setAccessible(true)
              val (name, value) = (field.getName, field.get(instance))
              field.setAccessible(false)
              annotation =&gt; annotation match {
                  case min: Min =&gt; minValidate(name, value, min.value())
                  case size: Size =&gt; sizeValidate(name, value, size.min(), size.max())
              }
          }
      }.flatten[ValidationResult].foldLeft(().successNel[String])(_ |@| _)
  }
  </code></pre>
  
  <p>The <code>minValidate</code> and <code>sizeValidate</code> functions just return <code>ValidationResults</code>.</p>
  
  <p>The problem is, this code won't compile.  The error message is:</p>
  
  <pre><code>Type mismatch, expected F0.type#M[NotInferedB], actual: ValidationResult
  </code></pre>
  
  <p>I have no idea what that means... do I need to give Scala more type info?</p>
  
  <p>What I'm trying to accomplish is, if all fields are <code>successNel</code>s, then return that, otherwise, return a combination of all the <code>failureNel</code>s.</p>
  
  <p>Has <code>|@|</code> changed since previous version of Scalaz?  Because even if I do something like:</p>
  
  <pre><code>().successNel |@| ().successNel
  </code></pre>
  
  <p>I get the same error.</p>
  
  <p><strong>Update</strong></p>
  
  <p>I started poking around the Scalaz source and I found the <code>+++</code> which seems to do what I want.</p>
  
  <p>What's the difference between <code>+++</code> and <code>|@|</code>?</p>