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

[RxScala] rxjava-scalaz: providing some type class instances. #1297

Merged
merged 2 commits into from Jun 25, 2014

Conversation

everpeace
Copy link
Contributor

Introduced 'rxjava-scalaz' project. This project provides some type class instances for Observable.

  • Monoid:
    Observable obviously forms a monoid in terms of concatenation.
  • Functor, Applicative, Monad, MonadPlus:
    Observable can be a Stream-like Monad and can be MonadPlus as well as Monoid.
  • Traverse, Foldable:
    Observable can be Stream-like traversable. Please note that the operations for the instance is blocking calls.
  • etc.

About testing, property based tests are applied by Scalaz's ScalaCheck binding.
For getting started, please refer to rx.java.scala.scalaz.examples.RxScalazDemo, or README.md.

Sample Usages

import scalaz._, Scalaz._
import rx.lang.scala.Observable
import rx.lang.scala.scalaz._

Observable.items(1, 2) |+| Observable.items(3, 4)               // === Observable.items(1 2 3 4)
Observable.items(1, 2) ∘ {_ + 1}                                // === Observable.items(2, 3)
(Observable.items(1, 2) |@| Observable.items(3, 4)) {_ + _}     // === Observable.items(4, 5, 5, 6)
1.η[Observable]                                                 // === Observable.items(1)
(Observable.items(3) >>= {(i: Int) => Observable.items(i + 1)}) // === Observable.items(4)

My original proposal is #1167

@cloudbees-pull-request-builder

RxJava-pull-requests #1195 FAILURE
Looks like there's a problem with this pull request

@cloudbees-pull-request-builder

RxJava-pull-requests #1196 FAILURE
Looks like there's a problem with this pull request

…lass instances for Observable.

* Monoid: Observable obviously forms a monoid in terms of concatenation.
* Functor, Applicative, Monad, MonadPlus: Observable can be a Stream-like Monad and can be MonadPlus as well as Monoid.
* Traverse, Foldable: Observable can be Stream-like traversable. __NOTE: The operations for the instance is blocking calls.__
* etc.

About Testing, property based tests are applied by Scalaz's ScalaCheck binding.

For QuickStart, please refer to rx.java.scala.scalaz.examples.RxScalazDemo.
@cloudbees-pull-request-builder

RxJava-pull-requests #1197 SUCCESS
This pull request looks good

@cloudbees-pull-request-builder

RxJava-pull-requests #1202 SUCCESS
This pull request looks good

@benjchristensen
Copy link
Member

Looks good to me ... just holding off on merge/release for a few days (for build server reasons).

Once we split RxScala into its own top-level project this looks like it would make sense to be a contrib module of it. Am I correct in that?

@everpeace
Copy link
Contributor Author

Looks good to me ... just holding off on merge/release for a few days (for build server reasons).

Thanks! OK. I'm looking forward to it.

Once we split RxScala into its own top-level project this looks like it would make sense to be
a contrib module of it. Am I correct in that?

Definitely!
By the way, the plan splitting RxScala was new to me! I'm glad to hear about when it would be occured.

@benjchristensen
Copy link
Member

I hope to have it done in the next month or two. Once 0.20 goes out (with #1000 done) then we are ready to move to 1.0 Release Candidates and split the project up.

@everpeace
Copy link
Contributor Author

Good news. Thanks. Yes, I think backpressure is really nice capability, which provides more flexible flow controllability to users.

benjchristensen added a commit that referenced this pull request Jun 25, 2014
[RxScala] rxjava-scalaz: providing some type class instances.
@benjchristensen benjchristensen merged commit 6ffe9d7 into ReactiveX:master Jun 25, 2014
@benjchristensen
Copy link
Member

So ... this is merged into trunk, but I had issues with the Netflix build system that releases to Maven Central. It had issues with this:

Artifact 'org.scalaz:scalaz-core_2.10:7.0.4@jar' not found.

I couldn't figure it out so let 0.19.2 go without this module and am waiting on someone who knows this stuff better than I helping me.

@everpeace
Copy link
Contributor Author

Sorry for inconvenience. Please go ahead without this module.
But I'm not sure why this error happens either...

@benjchristensen
Copy link
Member

It's something with the Netflix build server because it works fine from CloudBees and my local dev machine.

@everpeace
Copy link
Contributor Author

It's something with the Netflix build server because it works fine from CloudBees and my local dev machine.

@benjchristensen Did you, or any other guys, get any progress on this issue?

I would be very happy if you would revert the commit (fe83a31) by the next release.

If there is something I could help, please free to tell me.

Thanks,

@benjchristensen
Copy link
Member

It is now released in 0.19.6.

@everpeace
Copy link
Contributor Author

@benjchristensen I really appreciate it!

@everpeace everpeace deleted the rxjava-scalaz branch July 18, 2014 00:05
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

Successfully merging this pull request may close these issues.

None yet

3 participants