We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi,
Is there something missing in Either to be able to use it in your monad comprehension?
class ComprehensionSpec extends Specification { def "Uses fj.Either in a monad comprehension"(){ given: def s=Either.right("1") def i=Either.right(1) when: def sum=Comprehension.foreach { i1 << s.right() i2 << i.right() yield { (i1 as Integer) + i2 } } then: sum.isRight() } }
In this example I get an exception:
groovy.lang.MissingMethodException: No signature of method: fj.data.Either$RightProjection.flatMap() is applicable for argument types: (com.github.mperry.fg.Comprehension$_process_closure3) values: [com.github.mperry.fg.Comprehension$_process_closure3@5830b878] Possible solutions: flatten(), flatten(groovy.lang.Closure) at com.github.mperry.fg.Comprehension.process(Comprehension.groovy:66) at com.github.mperry.fg.Comprehension.startProcessing(Comprehension.groovy:26) at com.github.mperry.fg.Comprehension.yield(Comprehension.groovy:21) at com.b2boost.commons.monad.either.ComprehensionSpec._spock_feature_0_0_closure1(ComprehensionSpec.groovy:20) at com.b2boost.commons.monad.either.ComprehensionSpec._spock_feature_0_0_closure1(ComprehensionSpec.groovy) at com.github.mperry.fg.Comprehension.foreach(Comprehension.groovy:98) at com.b2boost.commons.monad.either.ComprehensionSpec.Uses fj.Either in a monad comprehension(ComprehensionSpec.groovy:17)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi,
Is there something missing in Either to be able to use it in your monad comprehension?
In this example I get an exception:
The text was updated successfully, but these errors were encountered: