Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

alternative applicative builder syntax doesn't work for type-classes of multiple arity #144

Closed
jedws opened this issue Sep 6, 2012 · 1 comment

Comments

@jedws
Copy link
Contributor

jedws commented Sep 6, 2012

given that the applicative builder syntax |@| now has deprecation warnings:

val (a, b) = 3.right[String] -> 4.right[String]
(a |@| b)(_+_)
    warning: method |@| in trait ApplyOps is deprecated: Use `^(f1,f2..fN)((a,b,c) => ..)` instead
               (a |@| b)(_+_)
                   ^
  scalaz.Unapply[scalaz.Apply,scalaz.\/[String,Int]]{type M[X] = scalaz.\/[String,X]; type A = Int}#M[Int] = \/-(7)

the documented alternative doesn't work for greater than arity type constructors such as / and Validation:

scala> ^(a, b)(_ + _)
<console>:16: error: type mismatch;
 found   : scalaz.\/[String,Int]
 required: ?F[?A]
Note that implicit conversions are not applicable because they are ambiguous:
 both method any2Ensuring in object Predef of type [A](x: A)Ensuring[A]
 and method any2ArrowAssoc in object Predef of type [A](x: A)ArrowAssoc[A]
 are possible conversion functions from scalaz.\/[String,Int] to ?F[?A]
              ^(a, b)(_ + _)
               ^
@larsrh
Copy link
Contributor

larsrh commented Oct 28, 2012

I guess this issue is obsolete now that |@| has been un-deprecated.

@larsrh larsrh closed this as completed Oct 28, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants