Skip to content

Instantly share code, notes, and snippets.

@pedrofurla
Created September 20, 2012 09:24
Show Gist options
  • Save pedrofurla/3754885 to your computer and use it in GitHub Desktop.
Save pedrofurla/3754885 to your computer and use it in GitHub Desktop.
Validation#flatmap is crazy
val a = fromEither(listing).toValidationNEL
val retr = { x:VideoListing => fromEither(lister.retrieveReport(x)).toValidationNEL }
val res0 = for (
l <- a;
rep <- retr(l)
) yield { rep }
main.scala:75: Unable to unapply type `scalaz.package.ValidationNEL[Exception,com.listify.upload.VideoListing]` into a type constructor of kind `M[_]` that is classified by the type class `scalaz.Bind`
[error] 1) Check that the type class is defined by compiling `implicitly[scalaz.Bind[<type constructor>]]`.
[error] 2) Review the implicits in object Unapply, which only cover common type 'shapes'
[error] (implicit not found: scalaz.Unapply[scalaz.Bind, scalaz.package.ValidationNEL[Exception,com.listify.upload.VideoListing]])
[error] l <- a;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment