An advanced, but easy to use, platform for writing functional applications in Java 8.

Overview

Getting Cyclops X (10)

Tutorial :

What's new in Cyclops X (cyclops 10)

cyclops-data-types

  • Fast purely functional datastructures (Vector, Seq / List, LazySeq / LazyList, NonEmptyList, HashSet, TreeSet, TrieSet, HashMap, LinkedMap, MultiMap, TreeMap, BankersQueue, LazyString, Discrete Interval Encoded Tree, Zipper, Range, Tree, DifferenceList, HList, Dependent Map )
  • Structural Pattern Matching API (deconstruct algebraic product and sum types)
  • Improved type safety via the removal of unsafe APIs -- E.g. Unlike Optional, Option has no get method (which could throw a null pointer) -- New data structures do not support operations that would throw exceptions (you can't call head on an empty list for example)
  • Eager and Lazy alternatives for most datastructures (Option is eager, Maybe is lazy + reactive)
  • Improved naming of types (Function1-8 rather than Fn1-8, Either not Xor)
  • Group id is changed to com.oath.cyclops
  • Versioning between cyclops-react and cyclops is merged on cyclops versioning scheme (version 10 = Cyclops X)
  • Light weight dependencies : reactive-streams API, KindedJ & Agrona
  • JVM Polyglot Higher Kinded Types Support with KindedJ

Modules

Gradle

where x.y.z represents the latest version

compile 'com.oath.cyclops:cyclops:x.y.z'

Maven

<dependency>
    <groupId>com.oath.cyclops</groupId>
    <artifactId>cyclops</artifactId>
    <version>x.y.z</version>
</dependency>

screen shot 2016-02-22 at 8 44 42 pm

Powerful Streams and functional data types for building modern Java 8 applications. We extend JDK interfaces where possible for maximum integration.

This is the 10.x branch for 2.x branch click the link below

License

cyclops is licensed under the Apache 2.0 license.

http://www.apache.org/licenses/LICENSE-2.0

Thanks to our Sponsors

Comments
  • Batching works in an unexpected way when using futureStream

    Batching works in an unexpected way when using futureStream

    0 down vote favorite

    I am trying to use cyclops-react to batch the elements from a queue, based on size, but also on time, so it doesn't block when there are no elements

    Maybe the functionality is not what I expected or I am doing something wrong

    The complete code (Groovy) is like this with the producer in another thread:

                Queue<String> queue = QueueFactories.<String>unboundedQueue().build();
        new Thread({
            while (true) {
                sleep(1000)
                queue.offer("New message " + System.currentTimeMillis());
            }
        }).start();
    
        StreamSource.futureStream(queue, new LazyReact(ThreadPools.queueCopyExecutor))
                .groupedBySizeAndTime(10,500,TimeUnit.MILLISECONDS)
                .forEach({i->println(i + " Batch Time: ${System.currentTimeMillis()}")})
    

    The output is:

        [New message 1487673650332,  Batch Time: 1487673651356]
        [New message 1487673651348, New message 1487673652352,  Batch Time: 1487673653356]
        [New message 1487673653355, New message 1487673654357,  Batch Time: 1487673655362]
        [New message 1487673655362, New message 1487673656364,  Batch Time: 1487673657365]
    

    But I was expecting one element in each batch since the delay between elements offered is 1 second but the batching is every half a second

    Also I tried with an asynchronous stream (Groovy code):

        Queue<String> queue = QueueFactories.<String>unboundedQueue().build();
        StreamSource.futureStream(queue, new LazyReact(ThreadPools.queueCopyExecutor))
                .async()
                .groupedBySizeAndTime(10, 500,TimeUnit.MILLISECONDS)
                .peek({i->println(i + "Batch Time: ${System.currentTimeMillis()}")}).run();
    
        while (true) {
            queue.offer("New message " + System.currentTimeMillis());
            sleep(1000)
        }
    

    Again, it only batches every 2 seconds sometimes waiting for two elements per batch, even if the timeout in the batch is half second:

        [New message 1487673877780, Batch Time: 1487673878819]
        [New message 1487673878811, New message 1487673879812, Batch Time: 1487673880815]
        [New message 1487673880814, New message 1487673881819, Batch Time: 1487673882823]
        [New message 1487673882823, New message 1487673883824, Batch Time: 1487673884828]
        [New message 1487673884828, New message 1487673885831, Batch Time: 1487673886835]
    

    I did a third experiment with a non future non lazy stream, and this time it worked.

    Queue<String> queue = QueueFactories.<String>unboundedQueue().build();
       new Thread({
           while (true) {
               sleep(1000)
               queue.offer("New message " + System.currentTimeMillis());
           }
       }).start();
    
       queue.stream()
               .groupedBySizeAndTime(10,500,TimeUnit.MILLISECONDS)
               .forEach({i->println(i + " Batch Time " + System.currentTimeMillis())})
    

    Result:

      [New message 1487673288017, New message 1487673289027,  Batch Time , 1487673289055]
       [New message 1487673290029,  Batch Time , 1487673290029]
       [New message 1487673291033,  Batch Time , 1487673291033]
       [New message 1487673292037,  Batch Time , 1487673292037]
    

    Why is the behaviour of the batching seems to be wrong when you use a future stream?

    bug 
    opened by JesusMetapack 15
  • Remove zip(Seq<U> seq) from Traversable

    Remove zip(Seq seq) from Traversable

    This needs to be present on ReactiveSeq and LazyFutureStream for compatibility reasons with jOOλ, but makes less sense than a more general zipStream(Stream) (which also exists), on extended Collections and other Traversables.

    enhancement Traversables 
    opened by johnmcclean 10
  • Parallel streaming issue

    Parallel streaming issue

    Hello,

    I have trouble in parallel processing the with the latest version (1.0.0-Final):

    public class Init {
        public static void main(String args[])
        {
            int cores = Runtime.getRuntime().availableProcessors();
            System.setProperty("java.util.concurrent.ForkJoinPool.common.parallelism", String.valueOf(cores*4));
    
            for(int k=0; k < 10;k++) {
    
                com.aol.cyclops.data.async.Queue<Integer> queue = QueueFactories.<Integer>boundedQueue(5000).build();
    
                new Thread(() -> {
                    while(!queue.isOpen());
                    System.err.println(queue.close());
                }).start();
    
                Stream<Integer> stream = queue.jdkStream();
    
                stream = stream.parallel();
                stream.forEach(e ->
                {
                    System.out.println(e);
                });
                System.out.println("done " + k);
            }
        }
    }
    

    looks like mainthread/forkjoinpools threads waiting for the stream to close, if i comment out stream = stream.parallel(); above example works brilliant

    bug 
    opened by saschaarthur 9
  • Build a push api for ReactiveSeq

    Build a push api for ReactiveSeq

    Java 8 Streams are push based, but this is not exposed to end-users. To users they appear like chains or sequences of Iterators. Under the hood Streams make use of Spliterators which allow each phase to push data downstream to the next phase in the chain.

    It is straightforward to push data into Streams via a custom Spliterator, but building a full push API presents some challenges

    1. Error handling. With in-situ iterators and Spliterators error handling is simple. In this case we will have to provide a mechanism to register error handlers and propagate (push) errors into them.
    2. Collection & reduction - It is likely that collect(XXX) and reduce(XXX) won't work as expected. Before data is pushed into the system the Stream will appear empty resulting in an empty result (e.g. .collect(Collectors.toList()) would result in an empty List). forEach / forEachXEvents etc should work ok.
    3. foldFuture should be modified to produce a completed Future result only when onComplete has been received.
    enhancement 
    opened by johnmcclean 8
  • What diff between Do.addValues(1,2,3) and Do.add(Arrays.asList(1,2,3))

    What diff between Do.addValues(1,2,3) and Do.add(Arrays.asList(1,2,3))

    System.out.println( Do.add(ReactiveSeq.of("a","b","c"))
                    .add(Arrays.asList(1,2,3))
                    .yield(a->b->a + "#" + b)
                    .toListX() );
    

    works ok, but the following throws IllegalStateException( "stream has already been operated upon or closed") ::

    System.out.println( Do.add(ReactiveSeq.of("a","b","c"))
                    .addValues(1,2,3)
                    .yield(a->b->a + "#" + b)
                    .toListX() );
    

    What difference is about using the 2 api? And works OK with addStream(Supplier):

    System.out.println( Do.add(ReactiveSeq.of("a","b","c"))
                    .addStream(()->ReactiveSeq.of(1,2,3))
                    .yield(a->b->a + "#" + b)
                    .toListX() );
    

    but exception with a direct Stream:

     System.out.println( Do.add(ReactiveSeq.of("a","b","c"))
                    .add(ReactiveSeq.of(1,2,3))
                    .yield(a->b->a + "#" + b)
                    .toListX() );
    

    there may be need most unambiguous and explicit difference between of how to use them.

    bug 
    opened by langzhaozhi 8
  • Make shuffle lazy / intermediate operation

    Make shuffle lazy / intermediate operation

    Current shuffle implementation consumes the stream before shuffling. A reasonable compromise would be to group by some largeish number before before shuffling that collection, followed by flattening to a single traversable again.

    enhancement Traversables 
    opened by johnmcclean 8
  • LazyFutureStream

    LazyFutureStream

    Hi

    First congratulation for this great tools.

    i want to process a batch tool, in parallel for each files of the File.walk stream , how to mixed them ? like

        LazyFutureStream.parallel(Files.walk(dir))
                .forEach(id -> { //do work here
                            System.out.println(id + "\t" + Thread.currentThread());
                        });
    

    any idea ?

    Best regards Bruno

    help wanted 
    opened by brusand 7
  • Passing Class<X>... varargs parameter causes

    Passing Class... varargs parameter causes "Unchecked generics array creation" warning

    Varargs are just syntactic sugar for arrays, so using them in combination with generic types, this will always make the compile emit an "Unchecked generics array creation" warning if you call these methods. This happens in several places in cyclops-react.

    For example, the four Fn0..Fn3 implementations in cyclops.function.FluentFunctions (i.e. FluentSupplier, FluentFunction, FluentBiFunction and FluentTryFunction) all have a liftTry method taking a vararg Class<X> argument. Of course, we know this is safe, but perhaps there is a better way. I can think of a few:

    • providing several overloaded forms (for one Class<X>, for two, for three, ...)
    • adding a fluent API to call once for every Class<X>

    This is not a huge problem, but having to add @SuppressWarnings("unchecked") hurts a little every time I do it.

    bug 
    opened by laszlovandenhoek 6
  • Matchable documentation

    Matchable documentation

    Hi, there is really hard to follow the examples in the documentation. Here is an example on Matchables:

    The given documentation here seems to be not up to date anymore since the package structure does not "match" :trollface: anymore to the last version in maven (2.0.0-MI4).

    In detail, the part:

    import static com.aol.cyclops2.control.Matchable.otherwise;
    import static com.aol.cyclops2.control.Matchable.then;
    import static com.aol.cyclops2.control.Matchable.when;
    
    String m = Matchable.of(Optional.of(3))
                        .matches(
                             c->c.is(when(3),then("three")),otherwise("not three")
                            )
    

    Is not possible because of missing control.Matchable in cyclops2. There is the same case with the Monatic documentation at least.

    is there any plan to consolidate the documentation? It would be really helpful!

    bug 
    opened by allquantor 6
  • ReactiveSeqImpl.subscribe(Subscriber) assumes non-concurrent requesting

    ReactiveSeqImpl.subscribe(Subscriber) assumes non-concurrent requesting

    The Reactive-Streams specification is a bit vague on this but my experience is that one should not assume request() comes synchronously from the consumer of onNext.

    I'd like to contribute a proper RS iterator logic but I'm not sure which branch to target and how to deal with the 400+ compilation error I get from Eclipse when checking out master. (IntelliJ 2016.2.5 doesn't seem to be better).

    bug 
    opened by akarnokd 6
  • FluentFunctions : add support for asynchronous memoization (caching)

    FluentFunctions : add support for asynchronous memoization (caching)

    Caches may need to be invalidated periodically, but using Time To Live (TTL) caches that invalidate and are repopulated synchronously can cause performance to degrade dramatically for outlier percentiles (e.g. performance at the 99th percentile and above may be v. poor as the cache gets rebuilt at request time).

    A more stable approach is to always return results from memory and repopulate the cache entry asynchronously.

    In FluentFunctions we can create a asynchronous memoization methods with signatures like the following :-

              public FluentFunction<T, R> memoize(ScheduledExecutor ex, long timeToLive, TimeUnit timeUnit) ;
    
              public FluentFunction<T, R> memoize(ScheduledExecutor ex, String cron) ;
    

    Where cached values would be updated asyncrhonously on a schedule.

    And

               public FluentFunction<T, R> memoize(Executor ex, long timeToLive, TimeUnit timeUnit) ;
    

    Where a single cached value would be updated asynchronously, triggered on request when timeToLive has expired (the response would be returned immediately with the cached value updated asynchronously).

    These should be created for

    1. FluentSupplier
    2. FluentFunction
    3. FluentBiFunction
    4. FluentTriFunction
    enhancement control-types 
    opened by johnmcclean 6
  • Put dot between Binary and Operator

    Put dot between Binary and Operator

    Made T> into T>,

    I confirm that this contribution is made under the terms of the license found in the root directory of this repository's source tree and that I have the authority necessary to make this contribution on behalf of its copyright owner.

    opened by ghost 0
  • default = T3, R | apply(param,this)

    default = T3, R | apply(param,this)

    I confirm that this contribution is made under the terms of the license found in the root directory of AOL's repository's source tree and that I have the authority necessary to make this contribution on behalf of its copyright owner.

    opened by ghost 0
  • Jackson support for Option seems to not work?

    Jackson support for Option seems to not work?

    Describe the bug My object mapper is configured as so:

    ObjectMapper objectMapper = new ObjectMapper();
    objectMapper.registerModule(new CyclopsModule());
    objectMapper.registerModule(new Jdk8Module());
    

    I have a class defined as follows:

    class A {
       public int someField = 0;
    }
    
    class B {
       public Option<A> child = Option.none();
    }
    

    When I serialize an instance of B I get JSON like:

    {
     "child": null
    }
    

    When I attempt to deserialize the JSON produced I get an exception:

    Exception in thread "main" com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot find a Value deserializer for abstract type [reference type, class cyclops.control.Option<my.package.A><[simple type, class my.package.A]>]
    

    To Reproduce Described above

    Expected behavior JSON serialization AND deserialization should work...

    opened by OOPMan 1
  • Feature/maven build

    Feature/maven build

    I confirm that this contribution is made under the terms of the license found in the root directory of this repository's source tree and that I have the authority necessary to make this contribution on behalf of its copyright owner.

    opened by DarekDan 0
  • futureStream from Queue<T> does not fire on timeout.

    futureStream from Queue does not fire on timeout.

    Describe the bug I have created a reproducible test case, and it seems that this old issue still persists: https://stackoverflow.com/questions/42363084/using-cyclops-react-for-batching-on-a-async-queue-stream

    To Reproduce Steps to reproduce the behavior: Test case attached in comment.

    Expected behavior The future should be run after 200ms.

    opened by DarekDan 2
Releases(10.4.1)
  • 10.4.1(May 15, 2022)

    Cyclops 10.4.1

    What’s new Cyclops 10.4.1

    • Upgrade Jackson Databank and fix compatibility issue with latest
    • Fix bug in Memoize Memoize.memoizeSupplierAsync 

    Changelog

    Check out the features delivered and bugs fixed -

    github 10.4.1 issues & PRs

    Dependency changes

    Jackson Databind to 2.13.2

    Modules

    Get cyclops X

    Gradle

    Cyclops

    compile 'com.oath.cyclops:cyclops:10.4.1’
    

    Cyclops AnyM

    compile 'com.oath.cyclops:cyclops-anym:10.4.1’
    

    Cyclops Futurestream

    compile 'com.oath.cyclops:cyclops-futurestream:10.4.1’
    

    Cyclops Pure

    compile 'com.oath.cyclops:cyclops-pure:10.4.1’
    

    Cyclops Reactive Collections

    compile 'com.oath.cyclops:cyclops-reactive-collections:10.4.1’
    

    Cyclops Reactor Integration

       compile 'com.oath.cyclops:cyclops-reactor-integration:10.4.1'
    

    Cyclops RxJava2 Integration

       compile 'com.oath.cyclops:cyclops-rx2-integration:10.4.1'
    

    Cyclops Jackson Integration

       compile 'com.oath.cyclops:cyclops-jackson-integration:10.4.1'
    

    Maven

    Cyclops

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops</artifactId>
        <version>10.4.1</version>
    </dependency>
    

    Cyclops AnyM

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-anym</artifactId>
        <version>10.4.1</version>
    </dependency>
    

    Cyclops Futurestream

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-anym</artifactId>
        <version>10.4.1</version>
    </dependency>
    

    Cyclops Pure

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-pure</artifactId>
        <version>10.4.1</version>
    </dependency>
    

    Cyclops Reactive Collections

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-reactive-collections</artifactId>
        <version>10.4.1</version>
    </dependency>
    

    Cyclops Reactor Integration

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-reactor-integration</artifactId>
        <version>10.4.1</version>
    </dependency>
    

    Cyclops RxJava2 Integration

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-rx2-integration</artifactId>
        <version>10.4.1</version>
    </dependency>
    

    Cyclops Jackson Integration

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-jackson-integration</artifactId>
        <version>10.4.1</version>
    </dependency>
    

    License

    cyclops-react is licensed under the Apache 2.0 license.

    http://www.apache.org/licenses/LICENSE-2.0#

    What's Changed

    • Improve GRADLE build Performance by @shisheng-1 in https://github.com/aol/cyclops/pull/1110
    • Improve Travis CI build Performance by @YunLemon in https://github.com/aol/cyclops/pull/1109
    • chore: Upgrade to Gradle 7.2 by @johnmcclean in https://github.com/aol/cyclops/pull/1112
    • fix: Memoize issue fix by @johnmcclean in https://github.com/aol/cyclops/pull/1111

    New Contributors

    • @shisheng-1 made their first contribution in https://github.com/aol/cyclops/pull/1110
    • @YunLemon made their first contribution in https://github.com/aol/cyclops/pull/1109

    Full Changelog: https://github.com/aol/cyclops/compare/10.4.0...10.4.1

    Source code(tar.gz)
    Source code(zip)
  • 10.4.0(Jan 8, 2020)

    Cyclops 10.4.0

    What’s new Cyclops 10.4.0

    • Chain Datastructure (including Chain & NonEmptyChain) a new immutable List type with efficient prepending and appending a la https://typelevel.org/cats/datatypes/chain.html
    • partitionEithers, lefts, rights a la http://hackage.haskell.org/package/base-4.4.1.0/docs/Data-Either.html
    • Ior.sequenceBoth operator - which allows both the left and right side to be sequenced together
    • atLeast and atMost operators added which return true when a minimum number of true cases are found in a dataset (atLeast) or true when a maximum number of true cases are not found in a dataset (atMost)

    Changelog

    Check out the features delivered and bugs fixed -

    github 10.4.0 issues & PRs

    Dependency changes

    Agrona to 1.1.11 reactive-streams to 1.0.3 RxJava2 to 2.2.16 Reactor to 3.3.1-RELEASE

    Modules

    Get cyclops X

    Gradle

    Cyclops

    compile 'com.oath.cyclops:cyclops:10.4.0’
    

    Cyclops AnyM

    compile 'com.oath.cyclops:cyclops-anym:10.4.0’
    

    Cyclops Futurestream

    compile 'com.oath.cyclops:cyclops-futurestream:10.4.0’
    

    Cyclops Pure

    compile 'com.oath.cyclops:cyclops-pure:10.4.0’
    

    Cyclops Reactive Collections

    compile 'com.oath.cyclops:cyclops-reactive-collections:10.4.0’
    

    Cyclops Reactor Integration

       compile 'com.oath.cyclops:cyclops-reactor-integration:10.4.0'
    

    Cyclops RxJava2 Integration

       compile 'com.oath.cyclops:cyclops-rx2-integration:10.4.0'
    

    Cyclops Jackson Integration

       compile 'com.oath.cyclops:cyclops-jackson-integration:10.4.0'
    

    Maven

    Cyclops

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops</artifactId>
        <version>10.4.0</version>
    </dependency>
    

    Cyclops AnyM

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-anym</artifactId>
        <version>10.4.0</version>
    </dependency>
    

    Cyclops Futurestream

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-anym</artifactId>
        <version>10.4.0</version>
    </dependency>
    

    Cyclops Pure

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-pure</artifactId>
        <version>10.4.0</version>
    </dependency>
    

    Cyclops Reactive Collections

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-reactive-collections</artifactId>
        <version>10.4.0</version>
    </dependency>
    

    Cyclops Reactor Integration

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-reactor-integration</artifactId>
        <version>10.4.0</version>
    </dependency>
    

    Cyclops RxJava2 Integration

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-rx2-integration</artifactId>
        <version>10.4.0</version>
    </dependency>
    

    Cyclops Jackson Integration

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-jackson-integration</artifactId>
        <version>10.4.0</version>
    </dependency>
    

    License

    cyclops-react is licensed under the Apache 2.0 license.

    http://www.apache.org/licenses/LICENSE-2.0#

    Source code(tar.gz)
    Source code(zip)
  • 10.3.1(Jun 20, 2019)

    Cyclops 10.3.1

    What’s new Cyclops 10.3.1

    • Fixes Jackson Serialization Issue with Cyclops datastructures

    Changelog

    Check out the features delivered and bugs fixed -

    github 10.3.1 issues & PRs

    Dependency changes

    None this time

    Modules

    Get cyclops X

    Gradle

    Cyclops

    compile 'com.oath.cyclops:cyclops:10.3.1’
    

    Cyclops AnyM

    compile 'com.oath.cyclops:cyclops-anym:10.3.1’
    

    Cyclops Futurestream

    compile 'com.oath.cyclops:cyclops-futurestream:10.3.1’
    

    Cyclops Pure

    compile 'com.oath.cyclops:cyclops-pure:10.3.1’
    

    Cyclops Reactive Collections

    compile 'com.oath.cyclops:cyclops-reactive-collections:10.3.1’
    

    Cyclops Reactor Integration

       compile 'com.oath.cyclops:cyclops-reactor-integration:10.3.1'
    

    Cyclops RxJava2 Integration

       compile 'com.oath.cyclops:cyclops-rx2-integration:10.3.1'
    

    Cyclops Jackson Integration

       compile 'com.oath.cyclops:cyclops-jackson-integration:10.3.1'
    

    Maven

    Cyclops

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops</artifactId>
        <version>10.3.1</version>
    </dependency>
    

    Cyclops AnyM

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-anym</artifactId>
        <version>10.3.1</version>
    </dependency>
    

    Cyclops Futurestream

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-anym</artifactId>
        <version>10.3.1</version>
    </dependency>
    

    Cyclops Pure

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-pure</artifactId>
        <version>10.3.1</version>
    </dependency>
    

    Cyclops Reactive Collections

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-reactive-collections</artifactId>
        <version>10.3.1</version>
    </dependency>
    

    Cyclops Reactor Integration

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-reactor-integration</artifactId>
        <version>10.3.1</version>
    </dependency>
    

    Cyclops RxJava2 Integration

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-rx2-integration</artifactId>
        <version>10.3.1</version>
    </dependency>
    

    Cyclops Jackson Integration

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-jackson-integration</artifactId>
        <version>10.3.1</version>
    </dependency>
    

    License

    cyclops-react is licensed under the Apache 2.0 license.

    http://www.apache.org/licenses/LICENSE-2.0#

    Source code(tar.gz)
    Source code(zip)
  • 10.3.0(Mar 8, 2019)

    Cyclops 10.3.0

    What’s new Cyclops 10.3.0

    • reactive-streams enhancements!
    • Circuit breaking onError and recoverWith Operators ** Available on ReactiveSeq (reactive-streams push : ReactiveStreamX and iterative pull StreamX) ** Available on IO (use With ReactiveSeq, Flux or Flowable!)
    • Eval operators completion : streamWhile, streamUntil use reactive-streams instances when Eval is async
    • Non-backpressure based async Streams have been deprecated - the ReactiveSeq API is designed for controlled flows whether push based and asynchronous or pull based and synchronous
    • Bug fixes : reactive-streams async initialisation error, zip stackoverlow, FutureStream error progagation

    Bug fixes

    Recursive error handling

    IO.of(1, 2, 3)
      .mapChecked(this::loadFromDb)
      .recoverWith(this::loadFromNextSource)
      .stream()
      .vector()
    

    If loadFromDB fails, we will fall back to loadFromNextSource, if that fails we will fallback again to loadFromNextSource which gets the opportunity to choose a different source.

    Changelog

    Check out the features delivered and bugs fixed -

    github 10.3.0 issues & PRs

    Dependency changes

    Agrona to 0.9.33 Reactor to 3.2.6.RELEASE RxJava2 to 2.2.7 Jackson to 2.9.8

    Modules

    Get cyclops X

    Gradle

    Cyclops

    compile 'com.oath.cyclops:cyclops:10.3.0’
    

    Cyclops AnyM

    compile 'com.oath.cyclops:cyclops-anym:10.3.0’
    

    Cyclops Futurestream

    compile 'com.oath.cyclops:cyclops-futurestream:10.3.0’
    

    Cyclops Pure

    compile 'com.oath.cyclops:cyclops-pure:10.3.0’
    

    Cyclops Reactive Collections

    compile 'com.oath.cyclops:cyclops-reactive-collections:10.3.0’
    

    Cyclops Reactor Integration

       compile 'com.oath.cyclops:cyclops-reactor-integration:10.3.0'
    

    Cyclops RxJava2 Integration

       compile 'com.oath.cyclops:cyclops-rx2-integration:10.3.0'
    

    Cyclops Jackson Integration

       compile 'com.oath.cyclops:cyclops-jackson-integration:10.3.0'
    

    Maven

    Cyclops

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops</artifactId>
        <version>10.3.0</version>
    </dependency>
    

    Cyclops AnyM

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-anym</artifactId>
        <version>10.3.0</version>
    </dependency>
    

    Cyclops Futurestream

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-anym</artifactId>
        <version>10.3.0</version>
    </dependency>
    

    Cyclops Pure

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-pure</artifactId>
        <version>10.3.0</version>
    </dependency>
    

    Cyclops Reactive Collections

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-reactive-collections</artifactId>
        <version>10.3.0</version>
    </dependency>
    

    Cyclops Reactor Integration

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-reactor-integration</artifactId>
        <version>10.3.0</version>
    </dependency>
    

    Cyclops RxJava2 Integration

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-rx2-integration</artifactId>
        <version>10.3.0</version>
    </dependency>
    

    Cyclops Jackson Integration

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-jackson-integration</artifactId>
        <version>10.3.0</version>
    </dependency>
    

    License

    cyclops-react is licensed under the Apache 2.0 license.

    http://www.apache.org/licenses/LICENSE-2.0#

    Source code(tar.gz)
    Source code(zip)
  • 10.2.0(Jan 31, 2019)

    Cyclops 10.2.0

    What’s new Cyclops 10.2.0

    • cyclops-pure enhancements
    • More performant type class instance implementations
    • Deprecate AnyM in favour of the Do Builder in cyclops-pure

    Bug fixes

    Changelog

    Check out the features delivered and bugs fixed -

    github 10.2.0 issues & PRs

    Dependency changes

    Agrona to 0.9.31 Reactor to 3.2.5.RELEASE RxJava2 to 2.2.6

    Modules

    Get cyclops X

    Gradle

    Cyclops

    compile 'com.oath.cyclops:cyclops:10.2.0’
    

    Cyclops AnyM

    compile 'com.oath.cyclops:cyclops-anym:10.2.0’
    

    Cyclops Futurestream

    compile 'com.oath.cyclops:cyclops-futurestream:10.2.0’
    

    Cyclops Pure

    compile 'com.oath.cyclops:cyclops-pure:10.2.0’
    

    Cyclops Reactive Collections

    compile 'com.oath.cyclops:cyclops-reactive-collections:10.2.0’
    

    Cyclops Reactor Integration

       compile 'com.oath.cyclops:cyclops-reactor-integration:10.2.0'
    

    Cyclops RxJava2 Integration

       compile 'com.oath.cyclops:cyclops-rx2-integration:10.2.0'
    

    Cyclops Jackson Integration

       compile 'com.oath.cyclops:cyclops-jackson-integration:10.2.0'
    

    Maven

    Cyclops

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops</artifactId>
        <version>10.2.0</version>
    </dependency>
    

    Cyclops AnyM

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-anym</artifactId>
        <version>10.2.0</version>
    </dependency>
    

    Cyclops Futurestream

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-anym</artifactId>
        <version>10.2.0</version>
    </dependency>
    

    Cyclops Pure

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-pure</artifactId>
        <version>10.2.0</version>
    </dependency>
    

    Cyclops Reactive Collections

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-reactive-collections</artifactId>
        <version>10.2.0</version>
    </dependency>
    

    Cyclops Reactor Integration

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-reactor-integration</artifactId>
        <version>10.2.0</version>
    </dependency>
    

    Cyclops RxJava2 Integration

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-rx2-integration</artifactId>
        <version>10.2.0</version>
    </dependency>
    

    Cyclops Jackson Integration

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-jackson-integration</artifactId>
        <version>10.2.0</version>
    </dependency>
    

    License

    cyclops-react is licensed under the Apache 2.0 license.

    http://www.apache.org/licenses/LICENSE-2.0#

    Source code(tar.gz)
    Source code(zip)
  • 10.1.1(Dec 17, 2018)

    Cyclops 10.1.1

    What’s new Cyclops 10.1.1

    Bug fixes

    Changelog

    Check out the features delivered and bugs fixed -

    github 10.1.1 issues & PRs

    Dependency changes

    None this time

    Modules

    Get cyclops X

    Gradle

    Cyclops

    compile 'com.oath.cyclops:cyclops:10.1.1’
    

    Cyclops AnyM

    compile 'com.oath.cyclops:cyclops-anym:10.1.1’
    

    Cyclops Futurestream

    compile 'com.oath.cyclops:cyclops-futurestream:10.1.1’
    

    Cyclops Pure

    compile 'com.oath.cyclops:cyclops-pure:10.1.1’
    

    Cyclops Reactive Collections

    compile 'com.oath.cyclops:cyclops-reactive-collections:10.1.1’
    

    Cyclops Reactor Integration

       compile 'com.oath.cyclops:cyclops-reactor-integration:10.1.1'
    

    Cyclops RxJava2 Integration

       compile 'com.oath.cyclops:cyclops-rx2-integration:10.1.1'
    

    Cyclops Jackson Integration

       compile 'com.oath.cyclops:cyclops-jackson-integration:10.1.1'
    

    Maven

    Cyclops

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops</artifactId>
        <version>10.1.1</version>
    </dependency>
    

    Cyclops AnyM

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-anym</artifactId>
        <version>10.1.1</version>
    </dependency>
    

    Cyclops Futurestream

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-anym</artifactId>
        <version>10.1.1</version>
    </dependency>
    

    Cyclops Pure

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-pure</artifactId>
        <version>10.1.1</version>
    </dependency>
    

    Cyclops Reactive Collections

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-reactive-collections</artifactId>
        <version>10.1.1</version>
    </dependency>
    

    Cyclops Reactor Integration

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-reactor-integration</artifactId>
        <version>10.1.1</version>
    </dependency>
    

    Cyclops RxJava2 Integration

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-rx2-integration</artifactId>
        <version>10.1.1</version>
    </dependency>
    

    Cyclops Jackson Integration

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-jackson-integration</artifactId>
        <version>10.1.1</version>
    </dependency>
    

    License

    cyclops-react is licensed under the Apache 2.0 license.

    http://www.apache.org/licenses/LICENSE-2.0#

    Source code(tar.gz)
    Source code(zip)
  • 10.1.0(Nov 27, 2018)

    Cyclops 10.1.0

    What’s new Cyclops 10.1.0

    • Generic pure functional programming with a new Do notation
    • takeWhileInclusive, takeUntilInclusive, dropWhileInclusive, dropUntilInclusive operators on ReactiveSeq
    • Type class performance improvements for Seq, Vector, LazySeq, IO, Publishers, Iterables and more

    Bug fixes

    • Spouts amb operator fixed
    • Spouts schedule Stream operator fix
    • Completable types no longer block on reactive-streams subscriptions
    • Deprecations (internal methods and misnamed types)

    Do Notation Examples

    
    Do.forEach(OptionInstances::monad)
        .__(some(10))
        .__(some(5))
        .yield((a,b)->a+b)
    
    

    Tagless Final

    Do.forEach(monad)
            ._of(amount)
            .__(this::debit)
            .__(_1(this::credit))
            .yield(__23(Tuple::tuple))
            .fold(fn);
    
    Algebra
    interface AccountAlgebra<W> {
    
        Higher<W,Account> debit(Account account, double amount);
        Higher<W, Account> credit(Account account, double amount);
    
    }
    

    Changelog

    Check out the features delivered and bugs fixed -

    github 10.1.0 issues & PRs

    Dependency changes

    Agrona to 0.9.27 Reactor to 3.2.3.RELEASE RxJava 2 to 2.2.4

    Modules

    Get cyclops X

    Gradle

    Cyclops

    compile 'com.oath.cyclops:cyclops:10.1.0’
    

    Cyclops AnyM

    compile 'com.oath.cyclops:cyclops-anym:10.1.0’
    

    Cyclops Futurestream

    compile 'com.oath.cyclops:cyclops-futurestream:10.1.0’
    

    Cyclops Pure

    compile 'com.oath.cyclops:cyclops-pure:10.1.0’
    

    Cyclops Reactive Collections

    compile 'com.oath.cyclops:cyclops-reactive-collections:10.1.0’
    

    Cyclops Reactor Integration

       compile 'com.oath.cyclops:cyclops-reactor-integration:10.1.0'
    

    Cyclops RxJava2 Integration

       compile 'com.oath.cyclops:cyclops-rx2-integration:10.1.0'
    

    Cyclops Jackson Integration

       compile 'com.oath.cyclops:cyclops-jackson-integration:10.1.0'
    

    Maven

    Cyclops

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops</artifactId>
        <version>10.1.0</version>
    </dependency>
    

    Cyclops AnyM

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-anym</artifactId>
        <version>10.1.0</version>
    </dependency>
    

    Cyclops Futurestream

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-anym</artifactId>
        <version>10.1.0</version>
    </dependency>
    

    Cyclops Pure

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-pure</artifactId>
        <version>10.1.0</version>
    </dependency>
    

    Cyclops Reactive Collections

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-reactive-collections</artifactId>
        <version>10.1.0</version>
    </dependency>
    

    Cyclops Reactor Integration

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-reactor-integration</artifactId>
        <version>10.1.0</version>
    </dependency>
    

    Cyclops RxJava2 Integration

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-rx2-integration</artifactId>
        <version>10.1.0</version>
    </dependency>
    

    Cyclops Jackson Integration

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-jackson-integration</artifactId>
        <version>10.1.0</version>
    </dependency>
    

    License

    cyclops-react is licensed under the Apache 2.0 license.

    http://www.apache.org/licenses/LICENSE-2.0#

    Source code(tar.gz)
    Source code(zip)
  • 10.0.4(Nov 20, 2018)

    Cyclops X patch release 4 (10.0.4)

    What’s new Cyclops X patch release 4

    Bug fixes

    • mergeMap / concurrentFlatMapper bugs fixed
    • Sequence and Traverse added for Reactor Mono and Flux
    • Sequence and Traverse added for RxJava2 Single and Flowable
    • values() keys() methods added to ImmutableMaps
    • CollectionX removeAll fix
    • LazySeq / Seq removeValue and removeFirst performance optimisation
    • Reactive Collection more specific sub-types in return value for a number of operators (e.g. appendAll)

    Changelog

    Check out the features delivered and bugs fixed -

    github 10.0.4 issues & PRs

    Dependency changes

    None this time

    Modules

    Get cyclops X

    Gradle

    Cyclops

    compile 'com.oath.cyclops:cyclops:10.0.4’
    

    Cyclops AnyM

    compile 'com.oath.cyclops:cyclops-anym:10.0.4’
    

    Cyclops Futurestream

    compile 'com.oath.cyclops:cyclops-futurestream:10.0.4’
    

    Cyclops Pure

    compile 'com.oath.cyclops:cyclops-pure:10.0.4’
    

    Cyclops Reactive Collections

    compile 'com.oath.cyclops:cyclops-reactive-collections:10.0.4’
    

    Cyclops Reactor Integration

       compile 'com.oath.cyclops:cyclops-reactor-integration:10.0.4'
    

    Cyclops RxJava2 Integration

       compile 'com.oath.cyclops:cyclops-rx2-integration:10.0.4'
    

    Cyclops Jackson Integration

       compile 'com.oath.cyclops:cyclops-jackson-integration:10.0.4'
    

    Maven

    Cyclops

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops</artifactId>
        <version>10.0.4</version>
    </dependency>
    

    Cyclops AnyM

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-anym</artifactId>
        <version>10.0.4</version>
    </dependency>
    

    Cyclops Futurestream

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-anym</artifactId>
        <version>10.0.4</version>
    </dependency>
    

    Cyclops Pure

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-pure</artifactId>
        <version>10.0.4</version>
    </dependency>
    

    Cyclops Reactive Collections

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-reactive-collections</artifactId>
        <version>10.0.4</version>
    </dependency>
    

    Cyclops Reactor Integration

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-reactor-integration</artifactId>
        <version>10.0.4</version>
    </dependency>
    

    Cyclops RxJava2 Integration

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-rx2-integration</artifactId>
        <version>10.0.4</version>
    </dependency>
    

    Cyclops Jackson Integration

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-jackson-integration</artifactId>
        <version>10.0.4</version>
    </dependency>
    

    License

    cyclops-react is licensed under the Apache 2.0 license.

    http://www.apache.org/licenses/LICENSE-2.0#

    Source code(tar.gz)
    Source code(zip)
  • 10.0.3(Nov 10, 2018)

    Cyclops X patch release 3 (10.0.3)

    Cyclops X

    Cyclops X (cyclops 10) unifies cyclops-react and the cyclops integration modules on the cyclops versioning scheme. The goal of this project is remove a whole class of runtime errors from application code by providing much stricter APIs that prevent exceptional states from arising. A secondary goal is to modularize cyclops into a series of smaller more focused projects so that functionality is easy to find and developers only take what they need.

    What’s new Cyclops X

    -> Enhancements over cyclops-react 2

    • Fast purely functional datastructures (Vector, Seq / List, LazySeq / LazyList, NonEmptyList, HashSet, TreeSet, TrieSet, HashMap, LinkedMap, MultiMap, TreeMap, BankersQueue, LazyString, Discrete Interval Encoded Tree, Zipper, Range, Tree, DifferenceList, HList, Dependent Map )
    • Structural Pattern Matching API (deconstruct algebraic product and sum types)
    • Improved type safety via the removal of unsafe APIs -- E.g. Unlike Optional, Option has no get method (which could throw a null pointer) -- New data structures do not support operations that would throw exceptions (you can't call head on an empty list for example)
    • Eager and Lazy alternatives for most datastructures (Option is eager, Maybe is lazy + reactive)
    • Improved naming of types (Function1-8 rather than Fn1-8, Either not Xor)
    • Group id is changed to com.oath.cyclops
    • Versioning between cyclops-react and cyclops is merged on cyclops versioning scheme (version 10 = Cyclops X)
    • Light weight dependencies : reactive-streams API & Agrona
    • JVM polyglot higher kinder types support via KindedJ

    What’s new Cyclops X patch release 3

    Bug fixes

    • LazyEither dropping Left values, even when Throwable, when acting as reactive-streams Publisher
    • The internal resolve method in LazyEither should not be used in operator implementations [causes blocking behaviour on some operators on Maybe, LazyEither/3/4/5]
    • ConcurrentFlatMapper inner onError delegates to outer onError [causes mergeMap to finish early when data arriving from returned Publishers after upstream closed]
    • Make LazyEither creation from an Iterable lazy [LazyEither creation from an Iterable was Eager]

    Changelog

    Check out the features delivered and bugs fixed -

    github 10.0.3 issues & PRs

    Dependency changes

    agrona to 0.9.26 reactor to 3.2.2.RELEASE rxJava2 to 2.2.3 jackson to 2.9.7

    Modules

    Get cyclops X

    Gradle

    Cyclops

    compile 'com.oath.cyclops:cyclops:10.0.3’
    

    Cyclops AnyM

    compile 'com.oath.cyclops:cyclops-anym:10.0.3’
    

    Cyclops Futurestream

    compile 'com.oath.cyclops:cyclops-futurestream:10.0.3’
    

    Cyclops Pure

    compile 'com.oath.cyclops:cyclops-pure:10.0.3’
    

    Cyclops Reactive Collections

    compile 'com.oath.cyclops:cyclops-reactive-collections:10.0.3’
    

    Cyclops Reactor Integration

       compile 'com.oath.cyclops:cyclops-reactor-integration:10.0.3'
    

    Cyclops RxJava2 Integration

       compile 'com.oath.cyclops:cyclops-rx2-integration:10.0.3'
    

    Cyclops Jackson Integration

       compile 'com.oath.cyclops:cyclops-jackson-integration:10.0.3'
    

    Maven

    Cyclops

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops</artifactId>
        <version>10.0.3</version>
    </dependency>
    

    Cyclops AnyM

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-anym</artifactId>
        <version>10.0.3</version>
    </dependency>
    

    Cyclops Futurestream

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-anym</artifactId>
        <version>10.0.3</version>
    </dependency>
    

    Cyclops Pure

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-pure</artifactId>
        <version>10.0.3</version>
    </dependency>
    

    Cyclops Reactive Collections

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-reactive-collections</artifactId>
        <version>10.0.3</version>
    </dependency>
    

    Cyclops Reactor Integration

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-reactor-integration</artifactId>
        <version>10.0.3</version>
    </dependency>
    

    Cyclops RxJava2 Integration

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-rx2-integration</artifactId>
        <version>10.0.3</version>
    </dependency>
    

    Cyclops Jackson Integration

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-jackson-integration</artifactId>
        <version>10.0.3</version>
    </dependency>
    

    License

    cyclops-react is licensed under the Apache 2.0 license.

    http://www.apache.org/licenses/LICENSE-2.0#

    Source code(tar.gz)
    Source code(zip)
  • 10.0.2(Nov 1, 2018)

    Cyclops X patch release 1 (10.0.2)

    Cyclops X

    Cyclops X (cyclops 10) unifies cyclops-react and the cyclops integration modules on the cyclops versioning scheme. The goal of this project is remove a whole class of runtime errors from application code by providing much stricter APIs that prevent exceptional states from arising. A secondary goal is to modularize cyclops into a series of smaller more focused projects so that functionality is easy to find and developers only take what they need.

    What’s new Cyclops X

    -> Enhancements over cyclops-react 2

    • Fast purely functional datastructures (Vector, Seq / List, LazySeq / LazyList, NonEmptyList, HashSet, TreeSet, TrieSet, HashMap, LinkedMap, MultiMap, TreeMap, BankersQueue, LazyString, Discrete Interval Encoded Tree, Zipper, Range, Tree, DifferenceList, HList, Dependent Map )
    • Structural Pattern Matching API (deconstruct algebraic product and sum types)
    • Improved type safety via the removal of unsafe APIs -- E.g. Unlike Optional, Option has no get method (which could throw a null pointer) -- New data structures do not support operations that would throw exceptions (you can't call head on an empty list for example)
    • Eager and Lazy alternatives for most datastructures (Option is eager, Maybe is lazy + reactive)
    • Improved naming of types (Function1-8 rather than Fn1-8, Either not Xor)
    • Group id is changed to com.oath.cyclops
    • Versioning between cyclops-react and cyclops is merged on cyclops versioning scheme (version 10 = Cyclops X)
    • Light weight dependencies : reactive-streams API & Agrona
    • JVM polyglot higher kinder types support via KindedJ

    What’s new Cyclops X patch release 2

    • NonEmptyList reduce method that doesn’t require an identity element
    • LazyEither.later and LazyEither.always caching / non-caching factory methods

    Changelog

    Check out the features delivered and bugs fixed -

    github 10.0.2 issues & PRs

    Dependency changes

    None this time

    Modules

    Get cyclops X

    Gradle

    Cyclops

    compile 'com.oath.cyclops:cyclops:10.0.2’
    

    Cyclops AnyM

    compile 'com.oath.cyclops:cyclops-anym:10.0.2’
    

    Cyclops Futurestream

    compile 'com.oath.cyclops:cyclops-futurestream:10.0.2’
    

    Cyclops Pure

    compile 'com.oath.cyclops:cyclops-pure:10.0.2’
    

    Cyclops Reactive Collections

    compile 'com.oath.cyclops:cyclops-reactive-collections:10.0.2’
    

    Cyclops Reactor Integration

       compile 'com.oath.cyclops:cyclops-reactor-integration:10.0.2'
    

    Cyclops RxJava2 Integration

       compile 'com.oath.cyclops:cyclops-rx2-integration:10.0.2'
    

    Cyclops Jackson Integration

       compile 'com.oath.cyclops:cyclops-jackson-integration:10.0.2'
    

    Maven

    Cyclops

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops</artifactId>
        <version>10.0.2</version>
    </dependency>
    

    Cyclops AnyM

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-anym</artifactId>
        <version>10.0.2</version>
    </dependency>
    

    Cyclops Futurestream

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-anym</artifactId>
        <version>10.0.2</version>
    </dependency>
    

    Cyclops Pure

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-pure</artifactId>
        <version>10.0.2</version>
    </dependency>
    

    Cyclops Reactive Collections

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-reactive-collections</artifactId>
        <version>10.0.2</version>
    </dependency>
    

    Cyclops Reactor Integration

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-reactor-integration</artifactId>
        <version>10.0.2</version>
    </dependency>
    

    Cyclops RxJava2 Integration

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-rx2-integration</artifactId>
        <version>10.0.2</version>
    </dependency>
    

    Cyclops Jackson Integration

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-jackson-integration</artifactId>
        <version>10.0.2</version>
    </dependency>
    

    License

    cyclops-react is licensed under the Apache 2.0 license.

    http://www.apache.org/licenses/LICENSE-2.0#

    Source code(tar.gz)
    Source code(zip)
  • 10.0.1(Oct 30, 2018)

    Cyclops X patch release 1 (10.0.1)

    Cyclops X

    Cyclops X (cyclops 10) unifies cyclops-react and the cyclops integration modules on the cyclops versioning scheme. The goal of this project is remove a whole class of runtime errors from application code by providing much stricter APIs that prevent exceptional states from arising. A secondary goal is to modularize cyclops into a series of smaller more focused projects so that functionality is easy to find and developers only take what they need.

    What’s new Cyclops X

    -> Enhancements over cyclops-react 2

    • Fast purely functional datastructures (Vector, Seq / List, LazySeq / LazyList, NonEmptyList, HashSet, TreeSet, TrieSet, HashMap, LinkedMap, MultiMap, TreeMap, BankersQueue, LazyString, Discrete Interval Encoded Tree, Zipper, Range, Tree, DifferenceList, HList, Dependent Map )
    • Structural Pattern Matching API (deconstruct algebraic product and sum types)
    • Improved type safety via the removal of unsafe APIs -- E.g. Unlike Optional, Option has no get method (which could throw a null pointer) -- New data structures do not support operations that would throw exceptions (you can't call head on an empty list for example)
    • Eager and Lazy alternatives for most datastructures (Option is eager, Maybe is lazy + reactive)
    • Improved naming of types (Function1-8 rather than Fn1-8, Either not Xor)
    • Group id is changed to com.oath.cyclops
    • Versioning between cyclops-react and cyclops is merged on cyclops versioning scheme (version 10 = Cyclops X)
    • Light weight dependencies : reactive-streams API & Agrona
    • JVM polyglot higher kinder types support via KindedJ

    What’s new Cyclops X patch release 1

    • Views respect the semantics of the JDK Collection interfaces as defined in the Javadoc (i.e. UnsupportedOperationExceptions are thrown for add / remove etc).

    Changelog

    Check out the features delivered and bugs fixed -

    github 10.0.1 issues & PRs

    Dependency changes

    None this time

    Modules

    Get cyclops X

    Gradle

    Cyclops

    compile 'com.oath.cyclops:cyclops:10.0.1’
    

    Cyclops AnyM

    compile 'com.oath.cyclops:cyclops-anym:10.0.1’
    

    Cyclops Futurestream

    compile 'com.oath.cyclops:cyclops-futurestream:10.0.1’
    

    Cyclops Pure

    compile 'com.oath.cyclops:cyclops-pure:10.0.1’
    

    Cyclops Reactive Collections

    compile 'com.oath.cyclops:cyclops-reactive-collections:10.0.1’
    

    Cyclops Reactor Integration

       compile 'com.oath.cyclops:cyclops-reactor-integration:10.0.1'
    

    Cyclops RxJava2 Integration

       compile 'com.oath.cyclops:cyclops-rx2-integration:10.0.1'
    

    Cyclops Jackson Integration

       compile 'com.oath.cyclops:cyclops-jackson-integration:10.0.1'
    

    Maven

    Cyclops

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops</artifactId>
        <version>10.0.1</version>
    </dependency>
    

    Cyclops AnyM

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-anym</artifactId>
        <version>10.0.1</version>
    </dependency>
    

    Cyclops Futurestream

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-anym</artifactId>
        <version>10.0.1</version>
    </dependency>
    

    Cyclops Pure

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-pure</artifactId>
        <version>10.0.1</version>
    </dependency>
    

    Cyclops Reactive Collections

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-reactive-collections</artifactId>
        <version>10.0.1</version>
    </dependency>
    

    Cyclops Reactor Integration

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-reactor-integration</artifactId>
        <version>10.0.1</version>
    </dependency>
    

    Cyclops RxJava2 Integration

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-rx2-integration</artifactId>
        <version>10.0.1</version>
    </dependency>
    

    Cyclops Jackson Integration

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-jackson-integration</artifactId>
        <version>10.0.1</version>
    </dependency>
    

    License

    cyclops-react is licensed under the Apache 2.0 license.

    http://www.apache.org/licenses/LICENSE-2.0#

    Source code(tar.gz)
    Source code(zip)
  • 10.0.0-FINAL(Aug 31, 2018)

    Cyclops X FINAL (10.0.0-FINAL)

    Cyclops X

    Cyclops X (cyclops 10) unifies cyclops-react and the cyclops integration modules on the cyclops versioning scheme. The goal of this project is remove a whole class of runtime errors from application code by providing much stricter APIs that prevent exceptional states from arising. A secondary goal is to modularize cyclops into a series of smaller more focused projects so that functionality is easy to find and developers only take what they need.

    What’s new Cyclops X

    -> Enhancements over cyclops-react 2

    • Fast purely functional datastructures (Vector, Seq / List, LazySeq / LazyList, NonEmptyList, HashSet, TreeSet, TrieSet, HashMap, LinkedMap, MultiMap, TreeMap, BankersQueue, LazyString, Discrete Interval Encoded Tree, Zipper, Range, Tree, DifferenceList, HList, Dependent Map )
    • Structural Pattern Matching API (deconstruct algebraic product and sum types)
    • Improved type safety via the removal of unsafe APIs -- E.g. Unlike Optional, Option has no get method (which could throw a null pointer) -- New data structures do not support operations that would throw exceptions (you can't call head on an empty list for example)
    • Eager and Lazy alternatives for most datastructures (Option is eager, Maybe is lazy + reactive)
    • Improved naming of types (Function1-8 rather than Fn1-8, Either not Xor)
    • Group id is changed to com.oath.cyclops
    • Versioning between cyclops-react and cyclops is merged on cyclops versioning scheme (version 10 = Cyclops X)
    • Light weight dependencies : reactive-streams API & Agrona
    • JVM polyglot higher kinder types support via KindedJ

    What’s new Cyclops X FINAL Release

    • API enhancement : remove limit / skip overloads (remains on ReactiveSeq for Stream compatibility)
    • Recursion and concurrent Evaluation enhancements to Eval
    • Performance enhancements : core operations improved for Vector, Seq, LazySeq
    • Make illegal states unrepresentable : LazySeq is 100% lazy
    • IO enhancements : synchronous IO and FutureStream based concurrent IO

    API enhancement : remove limit / skip overloads

    • take / drop are used everywhere
    • only ReactiveSeq retains limit / skip as defined in the Stream API

    Recursion and concurrent Evaluation enhancements to Eval

    • Eval zipping should focus on supporting interleaving the execution of Evals

    The zip method on Eval can used to Evaluate multiple lazy code blocks concurrently, and only accepts another Eval, Trampoline or Supplier as a parameter.

    public void interleave(){
    
            Eval<Integer> algorithm1 = loop(50000,Eval.now(5));
            Eval<Integer> algorithm2 = loop2(50000,Eval.now(5));
    
            //interleaved execution via Zip!
            Tuple2<Integer, Integer> result = algorithm1.zip(algorithm2,Tuple::tuple).get();
    
            System.out.println(result);
    }
    
    Eval<Integer> loop2(int times,Eval<Integer> sum){
            System.out.println("Loop-B " + times + " : " + sum);
            if(times==0)
                return sum;
            else
                return sum.flatMap(s->loop2(times-1,Eval.now(s+times)));
    }
    
    Eval<Integer> loop(int times,Eval<Integer> sum){
            System.out.println("Loop-A " + times + " : " + sum);
            if(times==0)
                return sum;
            else
                return sum.flatMap(s->loop(times-1,Eval.now(s+times)));
    }
    Producing output showing executing of interleaved lazy calls
    Loop-B 15746 : Always[1126048874]
    Loop-A 15745 : Always[1126064620]
    Loop-B 15745 : Always[1126064620]
    Loop-A 15744 : Always[1126080365]
    Loop-B 15744 : Always[1126080365]
    Loop-A 15743 : Always[1126096109]
    Loop-B 15743 : Always[1126096109]
    Loop-A 15742 : Always[1126111852]
    Loop-B 15742 : Always[1126111852]
    Loop-A 15741 : Always[1126127594]
    
    

    Support Tail-recursion on methods that return a Supplier

    Ensure a clean Eval can be created from a Supplier that supports tail-recursion on methods with JDK Friendly method signatures.

    Supplier<Integer> loopSupplier(int times, int sum)
    Then using Eval, this call shouldn't blow the stack
    Supplier<Integer> algorithm1 = loopSupplier(50000,5);
    System.out.println(algorithm1.get());
    Provide a method to create an Eval from a Supplier
    Supplier<Integer> loopSupplier(int times, int sum){
            if(times==0)
                return ()->sum;
            else
                return eval(()->sum).flatMap(s->Evala.eval(loopSupplier(times-1,s+times)));
    }
    

    Performance enhancements : core operations improved for Vector, Seq, LazySeq

    Significant performance enhancements for append, get, setAt / update for core collections. E.g. Comparison with Vavr (post enhancements - Vavr was faster before) for Vector storing Strings

    • Append 10,000 Strings 50th percentile (ms/ops) :
    1. Vector (Vavr) : 0.222
    2. Vector (Cyclops) : 0.041 https://github.com/aol/cyclops-react/blob/master/cyclops/src/jmh/java/cyclops/DataAppend.java

    Make illegal states unrepresentable

    ** Make LazySeq totally lazy, solves numerous runtime errors and infinite loop issues e.g. in Scala

    Stream.continually(1)
    	    .filter(i=>false)
                .take(0)
                .isEmpty //infinite loop that never finishes!
    
    

    But Cyclops

    LazySeq.generate(()->1)
    	      .filter(I->false)
                  .take(0)
                  .isEmpty() //true! 
    

    IO enhancements : synchronous IO and FutureStream based concurrent IO

    • Synchronous IO For purely synchronous IO this model of execution will give better performance
    IO.sync(this::readData)
      .map(this::process)
      .map(this::save)
      .run()
    
    
    • FutureStream based IO for blocking concurrent operations
    FutureStreamIO.of(Executors.newCachedThreadPool(), this::readUserDataFromCache, this::readUserDataFromDisk, this::readUserDataFromDB)
                    .map(this::process)
                    .map(this::save)
                    .run()
    

    Changelog

    Check out the features delivered and bugs fixed -

    github 10.0.0-FINAL issues & PRs

    Dependency changes

    Reactive Streams to 1.0.2

    Modules

    Get cyclops X

    Gradle

    Cyclops

    compile 'com.oath.cyclops:cyclops:10.0.0-FINAL’
    

    Cyclops AnyM

    compile 'com.oath.cyclops:cyclops-anym:10.0.0-FINAL’
    

    Cyclops Futurestream

    compile 'com.oath.cyclops:cyclops-futurestream:10.0.0-FINAL’
    

    Cyclops Pure

    compile 'com.oath.cyclops:cyclops-pure:10.0.0-FINAL’
    

    Cyclops Reactive Collections

    compile 'com.oath.cyclops:cyclops-reactive-collections:10.0.0-FINAL’
    

    Cyclops Reactor Integration

       compile 'com.oath.cyclops:cyclops-reactor-integration:10.0.0-FINAL'
    

    Cyclops RxJava2 Integration

       compile 'com.oath.cyclops:cyclops-rx2-integration:10.0.0-FINAL'
    

    Cyclops Jackson Integration

       compile 'com.oath.cyclops:cyclops-jackson-integration:10.0.0-FINAL'
    

    Maven

    Cyclops

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops</artifactId>
        <version>10.0.0-FINAL</version>
    </dependency>
    

    Cyclops AnyM

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-anym</artifactId>
        <version>10.0.0-FINAL</version>
    </dependency>
    

    Cyclops Futurestream

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-anym</artifactId>
        <version>10.0.0-FINAL</version>
    </dependency>
    

    Cyclops Pure

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-pure</artifactId>
        <version>10.0.0-FINAL</version>
    </dependency>
    

    Cyclops Reactive Collections

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-reactive-collections</artifactId>
        <version>10.0.0-FINAL</version>
    </dependency>
    

    Cyclops Reactor Integration

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-reactor-integration</artifactId>
        <version>10.0.0-FINAL</version>
    </dependency>
    

    Cyclops RxJava2 Integration

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-rx2-integration</artifactId>
        <version>10.0.0-FINAL</version>
    </dependency>
    

    Cyclops Jackson Integration

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-jackson-integration</artifactId>
        <version>10.0.0-FINAL</version>
    </dependency>
    

    License

    cyclops-react is licensed under the Apache 2.0 license.

    http://www.apache.org/licenses/LICENSE-2.0#

    Source code(tar.gz)
    Source code(zip)
  • 10.0.0-RC1(Jul 25, 2018)

    Release Candidate 1 of Cyclops X

    List improvements

    • DifferenceList implements ImmutableList
    • lazyFoldRight added to LazySeq
    • Vector.size bug after take / drop fixes
    • splitAt / partition /span operators on Reactive Collections
    • NonEmptyList conversions

    Make illegal states unrepresentable

    • atPercentile returns an Option (when out of range percentiles are passed as input, Option.none is returned).

    Bug fixes

    • atPercentile bug fixes

    API & usability enhancements

    • Eq, Ord and NaturalTransformation should move to cyclops.function
    • Rename Function0..8 lift() to lazyLift
    • Move Comparators to cyclops.companion
    • Rename visit in LazySeq to foldLazySeq (similar in BankersQueue and Seq)

    lazyFoldRight

    There adds the ability to short circuit a la Haskell (see http://voidmainargs.blogspot.com/2011/08/folding-stream-with-scala.html)

    foldr (||) False (repeat True)
    True
    

    The following code runs forever

    LazySeq.generate(()->true)
           .foldRight(false,(a, b)->a ? true : b);
    

    But this does not

    LazySeq.generate(()->true)
           .lazyFoldRight(false,(a, b)->a ? true : b.get());
    //true
    

    Cyclops X

    Cyclops X (cyclops 10) unifies cyclops-react and the cyclops integration modules on the cyclops versioning scheme. The goal of this project is remove a whole class of runtime errors from application code by providing much stricter APIs that prevent exceptional states from arising. A secondary goal is to modularize cyclops into a series of smaller more focused projects so that functionality is easy to find and developers only take what they need.

    What’s new Cyclops X

    -> Enhancements over cyclops-react 2

    • Fast purely functional datastructures (Vector, Seq / List, LazySeq / LazyList, NonEmptyList, HashSet, TreeSet, TrieSet, HashMap, LinkedMap, MultiMap, TreeMap, BankersQueue, LazyString, Discrete Interval Encoded Tree, Zipper, Range, Tree, DifferenceList, HList, Dependent Map )
    • Structural Pattern Matching API (deconstruct algebraic product and sum types)
    • Improved type safety via the removal of unsafe APIs -- E.g. Unlike Optional, Option has no get method (which could throw a null pointer) -- New data structures do not support operations that would throw exceptions (you can't call head on an empty list for example)
    • Eager and Lazy alternatives for most datastructures (Option is eager, Maybe is lazy + reactive)
    • Improved naming of types (Function1-8 rather than Fn1-8, Either not Xor)
    • Group id is changed to com.oath.cyclops
    • Versioning between cyclops-react and cyclops is merged on cyclops versioning scheme (version 10 = Cyclops X)
    • Light weight dependencies : reactive-streams API & Agrona
    • JVM polyglot higher kinder types support via KindedJ

    What’s new Cyclops X Release Candidate 1

    • List enhancements
    • API simplification
    • bug fixes

    Changelog

    Check out the features delivered and bugs fixed -

    github 10.0.0-RC1 issues & PRs

    Dependency changes

    Agrona to 0.9.21 RxJava 2 to 2.1.16

    Modules

    Get cyclops X

    Gradle

    Cyclops

    compile 'com.oath.cyclops:cyclops:10.0.0-RC1’
    

    Cyclops AnyM

    compile 'com.oath.cyclops:cyclops-anym:10.0.0-RC1’
    

    Cyclops Futurestream

    compile 'com.oath.cyclops:cyclops-futurestream:10.0.0-RC1’
    

    Cyclops Pure

    compile 'com.oath.cyclops:cyclops-pure:10.0.0-RC1’
    

    Cyclops Reactive Collections

    compile 'com.oath.cyclops:cyclops-reactive-collections:10.0.0-RC1’
    

    Cyclops Reactor Integration

       compile 'com.oath.cyclops:cyclops-reactor-integration:10.0.0-RC1'
    

    Cyclops RxJava2 Integration

       compile 'com.oath.cyclops:cyclops-rx2-integration:10.0.0-RC1'
    

    Cyclops Jackson Integration

       compile 'com.oath.cyclops:cyclops-jackson-integration:10.0.0-RC1'
    

    Maven

    Cyclops

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops</artifactId>
        <version>10.0.0-RC1</version>
    </dependency>
    

    Cyclops AnyM

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-anym</artifactId>
        <version>10.0.0-RC1</version>
    </dependency>
    

    Cyclops Futurestream

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-anym</artifactId>
        <version>10.0.0-RC1</version>
    </dependency>
    

    Cyclops Pure

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-pure</artifactId>
        <version>10.0.0-RC1</version>
    </dependency>
    

    Cyclops Reactive Collections

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-reactive-collections</artifactId>
        <version>10.0.0-RC1</version>
    </dependency>
    

    Cyclops Reactor Integration

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-reactor-integration</artifactId>
        <version>10.0.0-RC1</version>
    </dependency>
    

    Cyclops RxJava2 Integration

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-rx2-integration</artifactId>
        <version>10.0.0-RC1</version>
    </dependency>
    

    Cyclops Jackson Integration

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-jackson-integration</artifactId>
        <version>10.0.0-RC1</version>
    </dependency>
    

    License

    cyclops-react is licensed under the Apache 2.0 license.

    http://www.apache.org/licenses/LICENSE-2.0#

    Source code(tar.gz)
    Source code(zip)
  • 10.0.0-M8(Jun 28, 2018)

    Milestone 8 of Cyclops X

    Make illegal states unrepresentable

    • retry methods now only available on reactive-types where error handling is expected
    • recover methods now only available on types where errors can be caught and recovered
    • Semigroup for NonEmptyList concatenation
    • Validated control type to represent valid and error states

    API Simplification

    • Streamable implements Stream
    • Streamable moved to cyclops.companion
    • mapReduce renamed foldMap
    • visit renamed fold
    • foldLeft favoured over reduce, reduce moved from non-stream types
    • Improved pattern matching API
    • endsWithIterable and startsWithIterable become endsWith and startsWith

    Handling effects with Reactive Streams

    • IO monad interface (cyclops.reactive)
    • reactive-streams based implementations of IO (cyclops ReactiveSeq, RxJava2 Flowable, Reactor Flux, generic higher kinded implementation in cyclops-pure based around Monad type class)
    • Managed monad interface - for managing resources (see https://www.iravid.com/posts/resource-management.html)
    • reactive streams based implementations of Managed (cyclops ReactiveSeq, RxJava2 Flowable, Reactor Flux, generic higher kinded implementation in cyclops-pure based around Monad type class)

    Managed monad

     SessionFactory factory;
     Try<String, Throwable> res = Managed.of(factory::openSession)
                                         .with(Session::beginTransaction)
                                         .map((session, tx) ->
                                               deleteFromMyTable(session)
                                                     .bipeek(success -> tx.commit(),error -> tx.rollback())
                                             )
                                         .foldRun(Try::flatten);
    
    public Try<String,Throwable> deleteFromMyTable(Session s);
    
    

    Using Reactor with cyclops IO Monad

    Autoclosing a resource

    FluxIO.of(()->10)
          .bracket(i-> new CloseableResource())
          .map(resource->process(resource))
          .run();
    

    Cyclops X

    Cyclops X (cyclops 10) unifies cyclops-react and the cyclops integration modules on the cyclops versioning scheme. The goal of this project is remove a whole class of runtime errors from application code by providing much stricter APIs that prevent exceptional states from arising. A secondary goal is to modularize cyclops into a series of smaller more focused projects so that functionality is easy to find and developers only take what they need.

    What’s new Cyclops X

    -> Enhancements over cyclops-react 2

    • Fast purely functional datastructures (Vector, Seq / List, LazySeq / LazyList, NonEmptyList, HashSet, TreeSet, TrieSet, HashMap, LinkedMap, MultiMap, TreeMap, BankersQueue, LazyString, Discrete Interval Encoded Tree, Zipper, Range, Tree, DifferenceList, HList, Dependent Map )
    • Structural Pattern Matching API (deconstruct algebraic product and sum types)
    • Improved type safety via the removal of unsafe APIs -- E.g. Unlike Optional, Option has no get method (which could throw a null pointer) -- New data structures do not support operations that would throw exceptions (you can't call head on an empty list for example)
    • Eager and Lazy alternatives for most datastructures (Option is eager, Maybe is lazy + reactive)
    • Improved naming of types (Function1-8 rather than Fn1-8, Either not Xor)
    • Group id is changed to com.oath.cyclops
    • Versioning between cyclops-react and cyclops is merged on cyclops versioning scheme (version 10 = Cyclops X)
    • Light weight dependencies : reactive-streams API & Agrona
    • JVM polyglot higher kinder types support via KindedJ

    What’s new Cyclops X Milestone 8

    • Improved safety / removal of unsafe apis
    • API simplification
    • promotion of cyclops-jackson-integration to core module
    • effect handling with reactive-streams

    Changelog

    Check out the features delivered and bugs fixed -

    github 10.0.0-M8 issues & PRs

    Dependency changes

    None this release

    Modules

    Get cyclops X

    Gradle

    Cyclops

    compile 'com.oath.cyclops:cyclops:10.0.0-M8’
    

    Cyclops AnyM

    compile 'com.oath.cyclops:cyclops-anym:10.0.0-M8’
    

    Cyclops Futurestream

    compile 'com.oath.cyclops:cyclops-futurestream:10.0.0-M8’
    

    Cyclops Pure

    compile 'com.oath.cyclops:cyclops-pure:10.0.0-M8’
    

    Cyclops Reactive Collections

    compile 'com.oath.cyclops:cyclops-reactive-collections:10.0.0-M8’
    

    Cyclops Reactor Integration

       compile 'com.oath.cyclops:cyclops-reactor-integration:10.0.0-M8'
    

    Cyclops RxJava2 Integration

       compile 'com.oath.cyclops:cyclops-rx2-integration:10.0.0-M8'
    

    Cyclops Jackson Integration

       compile 'com.oath.cyclops:cyclops-jackson-integration:10.0.0-M8'
    

    Maven

    Cyclops

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops</artifactId>
        <version>10.0.0-M8</version>
    </dependency>
    

    Cyclops AnyM

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-anym</artifactId>
        <version>10.0.0-M8</version>
    </dependency>
    

    Cyclops Futurestream

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-anym</artifactId>
        <version>10.0.0-M8</version>
    </dependency>
    

    Cyclops Pure

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-pure</artifactId>
        <version>10.0.0-M8</version>
    </dependency>
    

    Cyclops Reactive Collections

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-reactive-collections</artifactId>
        <version>10.0.0-M8</version>
    </dependency>
    

    Cyclops Reactor Integration

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-reactor-integration</artifactId>
        <version>10.0.0-M8</version>
    </dependency>
    

    Cyclops RxJava2 Integration

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-rx2-integration</artifactId>
        <version>10.0.0-M8</version>
    </dependency>
    

    Cyclops Jackson Integration

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-jackson-integration</artifactId>
        <version>10.0.0-M8</version>
    </dependency>
    

    License

    cyclops-react is licensed under the Apache 2.0 license.

    http://www.apache.org/licenses/LICENSE-2.0#

    Source code(tar.gz)
    Source code(zip)
  • 10.0.0-M7(Apr 10, 2018)

    Milestone 7 of Cyclops X

    cyclops-jackson-integration is a brand new Cyclops module that provides Jackson JSON serialisation and deserialisation for cyclops persistent collections and control types. Milestone 7 also bring the cyclops-vavr-integration module up-to-date (providing integration with cyclops-reactive-collections for Vavr persistent collections, and cyclops AnyM(onad) integration for Vavr monadic types).

    Other improvements in this release include

    • A better Eval implementation (under the hood changes making use of Cyclops’ Trampoline implementation).
    • Fixes to method and package names
    • Enhancments to cyclops Tuples (new concat methods)

    Jackson serialisation and derserialization

    import com.oath.cyclops.jackson.CyclopsModule;
    import com.fasterxml.jackson.databind.ObjectMapper;
    
    ObjectMapper mapper = new ObjectMapper();
    
    mapper.registerModule(new CyclopsModule());
    
    
    

    Serializing and deserializing a Cyclops Vector programmatically

    String json = JacksonUtil.serializeToJson(Vector.of(1,2,3));
    
    Vector<Integer> s = JacksonUtil.convertFromJson(json,Vector.class);
    //[1,2,3]
    
    

    Cyclops X

    Cyclops X (cyclops 10) unifies cyclops-react and the cyclops integration modules on the cyclops versioning scheme. The goal of this project is remove a whole class of runtime errors from application code by providing much stricter APIs that prevent exceptional states from arising. A secondary goal is to modularize cyclops into a series of smaller more focused projects so that functionality is easy to find and developers only take what they need.

    What’s new Cyclops X

    -> Enhancements over cyclops-react 2

    • Fast purely functional datastructures (Vector, Seq / List, LazySeq / LazyList, NonEmptyList, HashSet, TreeSet, TrieSet, HashMap, LinkedMap, MultiMap, TreeMap, BankersQueue, LazyString, Discrete Interval Encoded Tree, Zipper, Range, Tree, DifferenceList, HList, Dependent Map )
    • Structural Pattern Matching API (deconstruct algebraic product and sum types)
    • Improved type safety via the removal of unsafe APIs -- E.g. Unlike Optional, Option has no get method (which could throw a null pointer) -- New data structures do not support operations that would throw exceptions (you can't call head on an empty list for example)
    • Eager and Lazy alternatives for most datastructures (Option is eager, Maybe is lazy + reactive)
    • Improved naming of types (Function1-8 rather than Fn1-8, Either not Xor)
    • Group id is changed to com.oath.cyclops
    • Versioning between cyclops-react and cyclops is merged on cyclops versioning scheme (version 10 = Cyclops X)
    • Light weight dependencies : reactive-streams API & Agrona

    What’s new Cyclops X Milestone 5

    • Pure functional programming Module
    • flatMap and map Operators on Trampoline
    • reactive-streams based IO Monad
    • Safe PartialFunction API

    Changelog

    Check out the features delivered and bugs fixed -

    github 10.0.0-M7 issues & PRs

    Dependency changes

    None this release

    Modules

    Get cyclops X

    Gradle

    Cyclops

    compile 'com.oath.cyclops:cyclops:10.0.0-M7’
    

    Cyclops AnyM

    compile 'com.oath.cyclops:cyclops-anym:10.0.0-M7’
    

    Cyclops Futurestream

    compile 'com.oath.cyclops:cyclops-futurestream:10.0.0-M7’
    

    Cyclops Pure

    compile 'com.oath.cyclops:cyclops-pure:10.0.0-M7’
    

    Cyclops Reactive Collections

    compile 'com.oath.cyclops:cyclops-reactive-collections:10.0.0-M7’
    

    Cyclops Reactor Integration

       compile 'com.oath.cyclops:cyclops-reactor-integration:10.0.0-M7'
    

    Cyclops RxJava2 Integration

       compile 'com.oath.cyclops:cyclops-rx2-integration:10.0.0-M7'
    

    Cyclops RxJava Integration

       compile 'com.oath.cyclops:cyclops-rx-integration:10.0.0-M7'
    

    Cyclops Vavr Integration

       compile 'com.oath.cyclops:cyclops-vavr-integration:10.0.0-M7'
    

    Cyclops Jackson Integration

       compile 'com.oath.cyclops:cyclops-jackson-integration:10.0.0-M7'
    

    Maven

    Cyclops

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops</artifactId>
        <version>10.0.0-M7</version>
    </dependency>
    

    Cyclops AnyM

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-anym</artifactId>
        <version>10.0.0-M7</version>
    </dependency>
    

    Cyclops Futurestream

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-anym</artifactId>
        <version>10.0.0-M7</version>
    </dependency>
    

    Cyclops Pure

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-pure</artifactId>
        <version>10.0.0-M7</version>
    </dependency>
    

    Cyclops Reactive Collections

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-reactive-collections</artifactId>
        <version>10.0.0-M7</version>
    </dependency>
    

    Cyclops Reactor Integration     com.oath.cyclops     cyclops-reactor-integration     10.0.0-M7

    Cyclops RxJava2 Integration     com.oath.cyclops     cyclops-rx2-integration     10.0.0-M7

    Cyclops RxJava Integration         com.oath.cyclops     cyclops-rx-integration     10.0.0-M7

    Cyclops Vavr Integration     com.oath.cyclops     cyclops-vavr-integration     10.0.0-M7

    Cyclops Jackson Integration     com.oath.cyclops     cyclops-jackson-integration     10.0.0-M7

    Documentation

    Articles

    Old simple-react landing page

    License

    cyclops-react is licensed under the Apache 2.0 license.

    http://www.apache.org/licenses/LICENSE-2.0#

    Source code(tar.gz)
    Source code(zip)
  • 10.0.0-M6(Mar 11, 2018)

    Milestone 6 of Cyclops X

    Cyclops-reactive-collections is the last module to be created for Cyclops X (released in Milestone 6). Cyclops lazy and reactive extended collection types move out of the core into their own module, where they can be configured to run powered by Cyclops’ ReactiveSeq or by asynchronous streams in RxJava/2 or Pivotal’s Reactor.

    Cyclops Reactive Collections are a suite of extensions for JDK and Persistent Collection types that support a large range of operators as well as (smart) lazy execution of chained operators to drive performance and asynchronous data flows through those operators.

    As well as providing configuration options for the reactive engine powering the collections, it is possible to configure the collection types used. E.g. we can switch between Cyclops persistent collections or Vavr persistent collections.

    The core of cyclops has been refactored to use Cyclops’ own eager persistent data structures (such as Vector, Seq and LazySeq).

    Other improvements in this release include

    • Integration with KindedJ which provides a standard interface for simulated Higher Kinded types on the JVM (also used in the Arrow library for Kotlin)
    • A much enhanced LazyString implementation
    • More consistent naming of grouped and append method suites
    • cyclops-pure refactored to use cyclops persistent data types rather than extended collections
    • AnyM based monad transformers for core Cyclops Data types (OptionT, VectorT, LazySeqT, SeqT)

    Enhanced performance via laziness

    Chaining combinator operations on traditional functional datastructures such as the core persistent data structures provided in cyclops.data (or in Vavr or the Scala SDK) results in traversing the datastructure multiple times, once per combinator operation.

    E.g. to transform and filter a Cyclops Vector we could write code like the following

    
    Vector.of(1,2,3)
          .map(i->i*100)
          .filter(i->i<200);
    
    

    Each of the chained operations will traverse the Vector, once for map and once for filter.

    With Cyclops Reactive Collections VectorX the code remains very similar, the underlying datastructure remains identical, but the performance is much improved

    
    VectorX.of(1,2,3)
           .map(i->i*100)
           .filter(i->i<200);
    
    

    VectorX in contrast to a raw Vector traverses the underlying data structure just once.

    Performance improvement for Vavr's Vector when used with Cyclops VectorX

    Lower score is better

    • Raw Vavr Vector is on the Right.
    • Vavr Vector with Cyclops VectorX is on the left.
    screen shot 2018-03-01 at 15 14 43

    Reactive Collections!

    In the example below we asynchronously populate an Xtended list using an asynchronously executing ReactiveSeq. Additional reactive operations can be performed on the List asynchronously. The ListX only blocks on first access to the data.

    
    AtomicBoolean complete = new AtomicBoolean(false);
    
    
    ReactiveSeq<Integer> async =  Spouts.async(ReactiveSeq.of(1,2,3),Executors.newFixedThreadPool(1));
    
    ListX<Integer> asyncList = ListX.listX(async)
                                       .map(i->i+1);
    
    System.out.println("Blocked? " + complete.get());
    
    System.out.println("First value is "  + asyncList.get(0));
    
    System.out.println("Completed? " + complete.get());
    

    Which will print

    Blocked? false
    First value is 101
    Completed? true
    

    Available data structures

    cyclops.collections (mutable / immutable)

    | type | description | characteristics | |------|-------------|-----------------| | ListX | Functional extensions for working with Lists | Optionally Reactive or Coreactive, Lazy, mutable, immutable, 3rd party support, Higher kinded | | DequeX | Functional extensions for working with Deques | Optionally Reactive or Coreactive, Lazy, mutable, immutable, 3rd party support, Higher kinded | | QueueX | Functional extensions for working with Queues | Optionally Reactive or Coreactive, Lazy, mutable, immutable, 3rd party support, Higher kinded | | SetX | Functional extensions for working with Sets | Optionally Reactive or Coreactive, Lazy , mutable, immutable, 3rd party support | | SortedSetX | Functional extensions for working with SortedSets | Optionally Reactive or Coreactive, Lazy, mutable, immutable | | MapX | Functional extensions for working with Maps | Eager, mutable, immutable |

    cyclops.collections.persistent

    | type | description | characteristics | |------|-------------|-----------------| | LinkedListX | Functional extensions for working with persistent Lists | Optionally Reactive or Coreactive, Lazy, persistent, 3rd party support, Higher kinded | | VectorX | Functional extensions for working with persistent Vectors | Optionally Reactive or Coreactive, Lazy, persistent, 3rd party support, Higher kinded | | PersistentSetX | Functional extensions for working with persistent Sets | Optionally Reactive or Coreactive, Lazy, persistent, 3rd party support | | OrderedSetX | Functional extensions for working with persistent Ordered Sets | Optionally Reactive or Coreactive, Lazy, persistent, 3rd party support | | PersistentQueueX | Functional extensions for working with persistent Queues | Optionally Reactive or Coreactive, Lazy, persistent, 3rd party support, Higher kinded | | BagX | Functional extensions for working with persistent Bags (set like collections that allow duplicates) | Optionally Reactive or Coreactive,Lazy, persistent, 3rd party support |

    Examples

    Lazy execution using extended Collections

    Eval<Integer> lazyResult = ListX.of(1,2,3,4)
                                     .map(i->i*10)
                                     .foldLazy(s->s
                                     .reduce( 50,(acc,next) -> acc+next));
    

    Articles

    Cyclops X

    Cyclops X (cyclops 10) unifies cyclops-react and the cyclops integration modules on the cyclops versioning scheme. The goal of this project is remove a whole class of runtime errors from application code by providing much stricter APIs that prevent exceptional states from arising. A secondary goal is to modularize cyclops into a series of smaller more focused projects so that functionality is easy to find and developers only take what they need.

    What’s new Cyclops X

    -> Enhancements over cyclops-react 2

    • Fast purely functional datastructures (Vector, Seq / List, LazySeq / LazyList, NonEmptyList, HashSet, TreeSet, TrieSet, HashMap, LinkedMap, MultiMap, TreeMap, BankersQueue, LazyString, Discrete Interval Encoded Tree, Zipper, Range, Tree, DifferenceList, HList, Dependent Map )
    • Structural Pattern Matching API (deconstruct algebraic product and sum types)
    • Improved type safety via the removal of unsafe APIs -- E.g. Unlike Optional, Option has no get method (which could throw a null pointer) -- New data structures do not support operations that would throw exceptions (you can't call head on an empty list for example)
    • Eager and Lazy alternatives for most datastructures (Option is eager, Maybe is lazy + reactive)
    • Improved naming of types (Function1-8 rather than Fn1-8, Either not Xor)
    • Group id is changed to com.oath.cyclops
    • Versioning between cyclops-react and cyclops is merged on cyclops versioning scheme (version 10 = Cyclops X)
    • Light weight dependencies : reactive-streams API & Agrona

    What’s new Cyclops X Milestone 5

    • Pure functional programming Module
    • flatMap and map Operators on Trampoline
    • reactive-streams based IO Monad
    • Safe PartialFunction API

    Changelog

    Check out the features delivered and bugs fixed -

    github 10.0.0-M6 issues & PRs

    Dependency changes

    Cyclops no longer depends on pCollections or jOOλ

    Get cyclops X

    Gradle

    Cyclops

    compile 'com.oath.cyclops:cyclops:10.0.0-M6’
    

    Cyclops AnyM

    compile 'com.oath.cyclops:cyclops-anym:10.0.0-M6’
    

    Cyclops Futurestream

    compile 'com.oath.cyclops:cyclops-futurestream:10.0.0-M6’
    

    Cyclops Pure

    compile 'com.oath.cyclops:cyclops-pure:10.0.0-M6’
    

    Cyclops Reactive Collections

    compile 'com.oath.cyclops:cyclops-reactive-collections:10.0.0-M6’
    

    Maven

    Cyclops

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops</artifactId>
        <version>10.0.0-M6</version>
    </dependency>
    

    Cyclops AnyM

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-anym</artifactId>
        <version>10.0.0-M6</version>
    </dependency>
    

    Cyclops Futurestream

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-anym</artifactId>
        <version>10.0.0-M6</version>
    </dependency>
    

    Cyclops Pure

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-pure</artifactId>
        <version>10.0.0-M6</version>
    </dependency>
    

    Cyclops Reactive Collections

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-reactive-collections</artifactId>
        <version>10.0.0-M6</version>
    </dependency>
    

    Documentation

    Articles

    Old simple-react landing page

    License

    cyclops-react is licensed under the Apache 2.0 license.

    http://www.apache.org/licenses/LICENSE-2.0#

    Source code(tar.gz)
    Source code(zip)
  • 10.0.0-M5(Dec 25, 2017)

    Milestone 5 of Cyclops X

    M5 of Cyclops X introduces another new module cyclops-pure. Cyclops Pure provides additional control structures, typeclass definitions and instances for pure category theoritic functional programming in Java. Cyclops Pure simulates Higher Kinded Types using Witness Types (see Simulating Higher Kinded Types in Java ).

    Cyclops X

    Cyclops X (cyclops 10) unifies cyclops-react and the cyclops integration modules on the cyclops versioning scheme. The goal of this project is remove a whole class of runtime errors from application code by providing much stricter APIs that prevent exceptional states from arising. A secondary goal is to modularize cyclops into a series of smaller more focused projects so that functionality is easy to find and developers only take what they need.

    What’s new Cyclops X

    -> Enhancements over cyclops-react 2

    • Fast purely functional datastructures (Vector, Seq / List, LazySeq / LazyList, NonEmptyList, HashSet, TreeSet, TrieSet, HashMap, LinkedMap, MultiMap, TreeMap, BankersQueue, LazyString, Discrete Interval Encoded Tree, Zipper, Range, Tree, DifferenceList, HList, Dependent Map )
    • Structural Pattern Matching API (deconstruct algebraic product and sum types)
    • Improved type safety via the removal of unsafe APIs -- E.g. Unlike Optional, Option has no get method (which could throw a null pointer) -- New data structures do not support operations that would throw exceptions (you can't call head on an empty list for example)
    • Eager and Lazy alternatives for most datastructures (Option is eager, Maybe is lazy + reactive)
    • Improved naming of types (Function1-8 rather than Fn1-8, Either not Xor)
    • Group id is changed to com.oath.cyclops
    • Versioning between cyclops-react and cyclops is merged on cyclops versioning scheme (version 10 = Cyclops X)
    • Light weight dependencies : reactive-streams API & Agrona

    What’s new Cyclops X Milestone 5

    • Pure functional programming Module
    • flatMap and map Operators on Trampoline
    • reactive-streams based IO Monad
    • Safe PartialFunction API

    Changelog

    Check out the features delivered and bugs fixed -

    github 10.0.0-M5 issues & PRs

    Dependency changes

    Cyclops no longer depends on pCollections or jOOλ

    Get cyclops X

    Gradle

    Cyclops

    compile 'com.oath.cyclops:cyclops:10.0.0-M5’
    

    Cyclops AnyM

    compile 'com.oath.cyclops:cyclops-anym:10.0.0-M5’
    

    Cyclops Futurestream

    compile 'com.oath.cyclops:cyclops-futurestream:10.0.0-M5’
    

    Cyclops Pure

    compile 'com.oath.cyclops:cyclops-pure:10.0.0-M5’
    

    Maven

    Cyclops

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops</artifactId>
        <version>10.0.0-M5</version>
    </dependency>
    

    Cyclops AnyM

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-anym</artifactId>
        <version>10.0.0-M5</version>
    </dependency>
    

    Cyclops Futurestream

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-anym</artifactId>
        <version>10.0.0-M5</version>
    </dependency>
    

    Cyclops Pure

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-pure</artifactId>
        <version>10.0.0-M5</version>
    </dependency>
    

    Documentation

    Articles

    Old simple-react landing page

    License

    cyclops-react is licensed under the Apache 2.0 license.

    http://www.apache.org/licenses/LICENSE-2.0#

    Source code(tar.gz)
    Source code(zip)
  • 10.0.0-M4(Dec 20, 2017)

    Milestone 4 of Cyclops X

    M4 of Cyclops X introduces another new module cyclops-futurestream. Cyclops Futurestream provides support for asynchronous / parallel Streaming implemented as a Stream of Future based tasks. For developers familar with Java 8 Streams, this is a pretty easy to use API that can very performantly handle blocking I/O based tasks (such as block operations on resources from file, or remote systems / dbs).

    Cyclops X

    Cyclops X (cyclops 10) unifies cyclops-react and the cyclops integration modules on the cyclops versioning scheme. The goal of this project is remove a whole class of runtime errors from application code by providing much stricter APIs that prevent exceptional states from arising. A secondary goal is to modularize cyclops into a series of smaller more focused projects so that functionality is easy to find and developers only take what they need.

    What’s new Cyclops X

    -> Enhancements over cyclops-react 2

    • Fast purely functional datastructures (Vector, Seq / List, LazySeq / LazyList, NonEmptyList, HashSet, TreeSet, TrieSet, HashMap, LinkedMap, MultiMap, TreeMap, BankersQueue, LazyString, Discrete Interval Encoded Tree, Zipper, Range, Tree, DifferenceList, HList, Dependent Map )
    • Structural Pattern Matching API (deconstruct algebraic product and sum types)
    • Improved type safety via the removal of unsafe APIs -- E.g. Unlike Optional, Option has no get method (which could throw a null pointer) -- New data structures do not support operations that would throw exceptions (you can't call head on an empty list for example)
    • Eager and Lazy alternatives for most datastructures (Option is eager, Maybe is lazy + reactive)
    • Improved naming of types (Function1-8 rather than Fn1-8, Either not Xor)
    • Group id is changed to com.oath.cyclops
    • Versioning between cyclops-react and cyclops is merged on cyclops versioning scheme (version 10 = Cyclops X)
    • Light weight dependencies : reactive-streams API & Agrona

    What’s new Cyclops X Milestone 4

    • Futurestream Module
    • mapOrCatch / flatMapOrCatch operators added to Try
    • Transform method added to TupleN
    • Naming convention improvements : flatMapI / flatMapIterable to become concatMap. flatMapP / flatMapPublisher to become mergeMap
    • Performance improvements on Map / filter operations in Seq
    • Cyclops Try type safety and usability enhancements
    • Zippable type simplified
    • indexOf / lastIndexOf fold operator added

    Changelog

    Check out the features delivered and bugs fixed -

    github 10.0.0-M4 issues & PRs

    Dependency changes

    Cyclops no longer depends on pCollections or jOOλ

    Get cyclops X

    Gradle

    Cyclops

    compile 'com.oath.cyclops:cyclops:10.0.0-M4’
    

    Cyclops AnyM

    compile 'com.oath.cyclops:cyclops-anym:10.0.0-M4’
    

    Cyclops Futurestream

    compile 'com.oath.cyclops:cyclops-futurestream:10.0.0-M4’
    

    Maven

    Cyclops

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops</artifactId>
        <version>10.0.0-M4</version>
    </dependency>
    

    Cyclops AnyM

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-anym</artifactId>
        <version>10.0.0-M4</version>
    </dependency>
    

    Cyclops Futurestream

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-anym</artifactId>
        <version>10.0.0-M4</version>
    </dependency>
    

    Documentation

    Articles

    Old simple-react landing page

    License

    cyclops-react is licensed under the Apache 2.0 license.

    http://www.apache.org/licenses/LICENSE-2.0#

    Source code(tar.gz)
    Source code(zip)
  • 10.0.0-M3(Dec 11, 2017)

    Milestone three of Cyclops X

    M3 of Cyclops X introduces a new module cyclops-anym. All of the classes supporting higher kinded Monad abstraction AnyM have been moved to this module.

    Cyclops X

    Cyclops X (cyclops 10) unifies cyclops-react and the cyclops integration modules on the cyclops versioning scheme. The goal of this project is remove a whole class of runtime errors from application code by providing much stricter APIs that prevent exceptional states from arising. A secondary goal is to modularize cyclops into a series of smaller more focused projects so that functionality is easy to find and developers only take what they need.

    What’s new Cyclops X

    -> Enhancements over cyclops-react 2

    • Fast purely functional datastructures (Vector, Seq / List, LazySeq / LazyList, NonEmptyList, HashSet, TreeSet, TrieSet, HashMap, LinkedMap, MultiMap, TreeMap, BankersQueue, LazyString, Discrete Interval Encoded Tree, Zipper, Range, Tree, DifferenceList, HList, Dependent Map )
    • Structural Pattern Matching API (deconstruct algebraic product and sum types)
    • Improved type safety via the removal of unsafe APIs -- E.g. Unlike Optional, Option has no get method (which could throw a null pointer) -- New data structures do not support operations that would throw exceptions (you can't call head on an empty list for example)
    • Eager and Lazy alternatives for most datastructures (Option is eager, Maybe is lazy + reactive)
    • Improved naming of types (Function1-8 rather than Fn1-8, Either not Xor)
    • Group id is changed to com.oath.cyclops
    • Versioning between cyclops-react and cyclops is merged on cyclops versioning scheme (version 10 = Cyclops X)
    • Light weight dependencies : reactive-streams API & Agrona

    What’s new Cyclops X Milestone 3

    • AnyM Module
    • Bug in Hash Array Mapped Trie fixed

    Changelog

    Check out the features delivered and bugs fixed -

    github 10.0.0-M4 issues & PRs

    Dependency changes

    Cyclops no longer depends on pCollections or jOOλ

    Get cyclops X

    Gradle

    Cyclops

    compile 'com.oath.cyclops:cyclops:10.0.0-M3’
    

    Cyclops AnyM

    compile 'com.oath.cyclops:cyclops-anym:10.0.0-M3’
    

    Maven

    Cyclops

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops</artifactId>
        <version>10.0.0-M3</version>
    </dependency>
    

    Cyclops AnyM

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops-anym</artifactId>
        <version>10.0.0-M3</version>
    </dependency>
    

    Documentation

    Articles

    Old simple-react landing page

    License

    cyclops-react is licensed under the Apache 2.0 license.

    http://www.apache.org/licenses/LICENSE-2.0#

    Source code(tar.gz)
    Source code(zip)
  • 10.0.0-M2(Nov 14, 2017)

    Milestone two of Cyclops X

    Cyclops X (cyclops 10) unifies cyclops-react and the cyclops integration modules on the cyclops versioning scheme. The goal of this project is remove a whole class of runtime errors from application code by providing much stricter APIs that prevent exceptional states from arising. A secondary goal is to modularize cyclops into a series of smaller more focused projects so that functionality is easy to find and developers only take what they need.

    What’s new Cyclops X

    -> Enhancements over cyclops-react 2

    • Fast purely functional datastructures (Vector, Seq / List, LazySeq / LazyList, NonEmptyList, HashSet, TreeSet, TrieSet, HashMap, LinkedMap, MultiMap, TreeMap, BankersQueue, LazyString, Discrete Interval Encoded Tree, Zipper, Range, Tree, DifferenceList, HList, Dependent Map )
    • Structural Pattern Matching API (deconstruct algebraic product and sum types)
    • Improved type safety via the removal of unsafe APIs -- E.g. Unlike Optional, Option has no get method (which could throw a null pointer) -- New data structures do not support operations that would throw exceptions (you can't call head on an empty list for example)
    • Eager and Lazy alternatives for most datastructures (Option is eager, Maybe is lazy + reactive)
    • Improved naming of types (Function1-8 rather than Fn1-8, Either not Xor)
    • Group id is changed to com.oath.cyclops
    • Versioning between cyclops-react and cyclops is merged on cyclops versioning scheme (version 10 = Cyclops X)
    • Light weight dependencies : reactive-streams API & Agrona

    What’s new Cyclops X Milestone 2

    • JDK Collection Views on Immutable Data Structures
    • LazySeq map / flatMap / filter lazy bug fix
    • HashMappedArrayTrie minus bug fix

    Changelog

    Check out the features delivered and bugs fixed -

    github 10.0.0-M2 issues & PRs

    Dependency changes

    Cyclops no longer depends on pCollections or jOOλ

    Get cyclops X

    Gradle

    compile 'com.oath.cyclops:cyclops:10.0.0-M2’
    

    Maven

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops</artifactId>
        <version>10.0.0-M2</version>
    </dependency>
    

    Documentation

    Articles

    Old simple-react landing page

    License

    cyclops-react is licensed under the Apache 2.0 license.

    http://www.apache.org/licenses/LICENSE-2.0#

    Source code(tar.gz)
    Source code(zip)
  • 10.0.0-M1(Nov 3, 2017)

    Milestone one of Cyclops X

    Cyclops X (cyclops 10) unifies cyclops-react and the cyclops integration modules on the cyclops versioning scheme. The goal of this project is remove a whole class of runtime errors from application code by providing much stricter APIs that prevent exceptional states from arising. A secondary goal is to modularize cyclops into a series of smaller more focused projects so that functionality is easy to find and developers only take what they need.

    What’s new Cyclops X

    -> Enhancements over cyclops-react 2

    • Fast purely functional datastructures (Vector, Seq / List, LazySeq / LazyList, NonEmptyList, HashSet, TreeSet, TrieSet, HashMap, LinkedMap, MultiMap, TreeMap, BankersQueue, LazyString, Discrete Interval Encoded Tree, Zipper, Range, Tree, DifferenceList, HList, Dependent Map )
    • Structural Pattern Matching API (deconstruct algebraic product and sum types)
    • Improved type safety via the removal of unsafe APIs -- E.g. Unlike Optional, Option has no get method (which could throw a null pointer) -- New data structures do not support operations that would throw exceptions (you can't call head on an empty list for example)
    • Eager and Lazy alternatives for most datastructures (Option is eager, Maybe is lazy + reactive)
    • Improved naming of types (Function1-8 rather than Fn1-8, Either not Xor)
    • Group id is changed to com.oath.cyclops
    • Versioning between cyclops-react and cyclops is merged on cyclops versioning scheme (version 10 = Cyclops X)
    • Light weight dependencies : reactive-streams API & Agrona

    Changelog

    Check out the features delivered and bugs fixed -

    github 10.0.0-M1 issues & PRs

    Dependency changes

    Cyclops no longer depends on pCollections or jOOλ

    Get cyclops X

    Gradle

    compile 'com.oath.cyclops:cyclops:10.0.0-M1’
    

    Maven

    <dependency>
        <groupId>com.oath.cyclops</groupId>
        <artifactId>cyclops</artifactId>
        <version>10.0.0-M1</version>
    </dependency>
    

    Documentation

    Articles

    Old simple-react landing page

    License

    cyclops-react is licensed under the Apache 2.0 license.

    http://www.apache.org/licenses/LICENSE-2.0#

    Source code(tar.gz)
    Source code(zip)
  • v2.1.1(Oct 4, 2017)

    2.1.1 of cyclops-react

    What’s new cyclops-react v2.1.1

    Various bug fixes.

    • Fix bug in ListX.with method
    • Eval.now filter issue
    • Unlawful Groups removed

    Enhancements

    • JDK 9 Iterate methods for extended collections
    • Kleisli for comprehensions
    • Static tailRec methods on monad types

    Changelog

    Check out the features delivered and bugs fixed -

    github 2.1.1 issues & PRs

    Dependency upgrades

    None this time

    Get cyclops-react

    Gradle

    compile 'com.aol.simplereact:cyclops-react:2.1.1’
    

    Maven

    <dependency>
        <groupId>com.aol.simplereact</groupId>
        <artifactId>cyclops-react</artifactId>
        <version>2.1.1</version>
    </dependency>
    

    Documentation

    Articles

    Old simple-react landing page

    License

    cyclops-react is licensed under the Apache 2.0 license.

    http://www.apache.org/licenses/LICENSE-2.0#

    Source code(tar.gz)
    Source code(zip)
  • 2.1.0(Aug 11, 2017)

    2.1.0 of cyclops-react

    What’s new cyclops-react v2.1.0

    MonadRec typeclass

    http://functorial.com/stack-safety-for-free/index.pdf Stack Safety for Free

    MonadRec<maybe> mr = Maybe.Instances.monadRec();
    Maybe<Integer> l = mr.tailRec(0, i -> i < 100_000 ? Maybe.just(Xor.secondary(i + 1)) : Maybe.just(Xor.primary(i + 1)))
                         .convert(Maybe::narrowK);
    //Just[100_001];
    
    

    Also available on Active

    Active<list,Integer> list = ListX.of(1,2,3).allTypeclasses();
    list.concreteTailRec(ListX.kindKleisli())
            .tailRec(1,i-> 1<100_000 ? ListX.of(Xor.secondary(i+1)) : ListX.of(Xor.primary(i)));
    
    //List[100_001]
    

    Enumeration data type and enum Streaming support

     ReactiveSeq.enums(Days.class)
                          .printOut();
    

    Monday Tuesday Wednesday Thursday Friday Saturday Sunday

    Enumeration.enums(Days.values())
                         .stream(Monday)
                         .join(" ")
    //"Monday Tuesday Wednesday Thursday Friday Saturday Sunday"
    
    Enumeration.enums(ListX.of(A,B,C,D,E,F,G,H,I,J))
                         .streamThenTo(A,C,G)
                         .join(" ");
    
    "A C E G"
    

    An effect type for composing side-effects

    E.g. asycnhronously push data into an Observable style stream, cycling 30 times

    Subscription sub = Spouts.asyncBufferBlock(10, s -> {
                if (i == 0) {
                    Effect e = () -> {
                        s.onNext("hello " + i++);
                    };
                    e.cycle(30).runAsync();
                }
            }
        ).forEach(2, in->count++);
    
    

    Buffering factory methods for reactive-streams and other async Stream types

    reactiveBuffer creates a buffering reactive-streams Stream. User code can ignore incoming request information, this is managed by the buffering Stream. Pushed events are buffered before being sent downstream when requested. Users can set the overflow policy between block and drop.

    Subscription sub = Spouts.reactiveBuffer(16, s -> {
    
        s.onSubscribe(new Subscription() {
            @Override
            public void request(long n) {
                if(i==0) {
    
                    Effect e = () -> {
    
    
                        s.onNext("hello " + i++);
                    };
                    e.cycle(30).runAsync();
                }
            }
    
            @Override
            public void cancel() {
    
            }
        });
    
    }).forEach(2, in->count++);
    
    
    //count will be 2, buffer will be 16
    Thread.sleep(500);
    
    sub.request(30);
    
    assertThat(i,equalTo(30));
    assertThat(count,equalTo(18));
    

    Changelog

    Check out the features delivered and bugs fixed -

    github 2.1.0 issues & PRs

    Dependency upgrades

    None this time

    Get cyclops-react

    Gradle

    compile 'com.aol.simplereact:cyclops-react:2.1.0’
    

    Maven

    <dependency>
        <groupId>com.aol.simplereact</groupId>
        <artifactId>cyclops-react</artifactId>
        <version>2.1.0</version>
    </dependency>
    

    Documentation

    Articles

    Old simple-react landing page

    License

    cyclops-react is licensed under the Apache 2.0 license.

    http://www.apache.org/licenses/LICENSE-2.0#

    Source code(tar.gz)
    Source code(zip)
  • v2.0.0-FINAL(Jul 4, 2017)

    2.0.0-FINAL of cyclops-react

    What’s new cyclops-react v2 - FINAL

    Reactive Try

    Try is now a Reactive data type, Try can operate eagerly (e.g. via Try.success, Try.failure,Try.withCatch, Try.runWithCatch), lazily (Try.fromIterable, Try.fromXor when an Either is used) or reactively (Try.fromPublisher or via toTry() on another reactive type).

    A Reactive Try

    ReactiveSeq<Integer> reactiveStream; //async populate a Stream with [1,2,3]
    
    Try<Integer,Throwable> attempt = Try.fromPublisher(reactiveStream, RuntimeException.class);
    Try<Integer,Throwable> doubled = attempt.map(i->i*2);
    
    //when the data arrives doubled will be (first value from the Stream doubled)
    //Try[2]
    

    An Eager try

    
    Try<Integer,Throwable> attempt = Try.success(1);
    Try<Integer,Throwable> doubled = attempt.map(i->i*2);
    
    //doubled will immediately be 
    //Try[2]
    

    A lazy try

    ReactiveSeq<Integer> reactiveStream = ReactiveSeq.of(1,2,3);
    
    Try<Integer,Throwable> attempt = Try.fromIterable(stream);
    Try<Integer,Throwable> doubled = attempt.map(i->i*2);
    
    //doubled when accessed first will become
    //Try[2]
    

    Concurrency via Trampoline zip (& also in Free & Unrestricted)

    Interleave execution of two looping algorithms

    
    Trampoline<Integer> looping = loop(500000,5);
    Trampoline<Integer> looping2 = loop2(500000,5);
    System.out.println(looping.zip(looping2).get());
    
    Trampoline<Integer> loop2(int times,int sum){
    
        System.out.println("Loop-B " + times + " : " + sum);
           if(times==0)
               return Trampoline.done(sum);
           else
               return Trampoline.more(()->loop2(times-1,sum+times));
       }
    
    Trampoline<Integer> loop(int times,int sum){
           System.out.println("Loop-A " + times + " : " + sum);
    	if(times==0)
    		return Trampoline.done(sum);
    	else
    		return Trampoline.more(()->loop(times-1,sum+times));
    }
    
    
    

    Prints

    …
    Loop-A 54 : 446196936
    Loop-B 54 : 446196936
    Loop-A 53 : 446196990
    Loop-B 53 : 446196990
    Loop-A 52 : 446197043
    Loop-B 52 : 446197043
    …
    

    Concurrency via recursive data types

    To execute two recursive algorithms simulatationously, convert to a Trampoline and zip!

    public void odd(){
        even(Maybe.just(200000)).toTrampoline()
                              .zip(odd1(Maybe.just(200000)).toTrampoline()).get();
    }
    public Maybe<String> odd(Maybe<Integer> n )  {
        System.out.println("A");
        return n.flatMap(x->even(Maybe.just(x-1)));
    }
    public Maybe<String> even(Maybe<Integer> n )  {
        return n.flatMap(x->{
            return x<=0 ? Maybe.just("done") : odd(Maybe.just(x-1));
        });
    }
    public Maybe<String> odd1(Maybe<Integer> n )  {
        System.out.println("B");
        return n.flatMap(x->even1(Maybe.just(x-1)));
    }
    public Maybe<String> even1(Maybe<Integer> n )  {
       
        return n.flatMap(x->{
            return x<=0 ? Maybe.just("done") : odd1(Maybe.just(x-1));
        });
    }
    

    Prints out

    A
    B
    A
    B
    A
    B
    A
    

    XorM and Coproduct

    A Sum type for monads of the same type. XorM / Coproduct are active type biased (rather than right biased).

    e.g.

    XorM<stream,optional,Integer> nums = XorM.stream(1,2,3)
                                                        .swap();
    int result = nums.map(i->i*2)
                    .foldLeft(Monoids.intSum);
    //12
    }
    

    Active and Nested data types

    Active wraps a HKT encoding and any associated typeclasses to provide a fluent java friendly interface. Nested does the same for nested HKT encodings (e.g. an Optional inside a List)

    Active<list,Integer> active = Active.of(ListX.of(1,2,3),ListX.Instances.definitions());
    Active<list,Integer> doubled = active.map(i->i*2);
    Active<list,Integer> doubledPlusOne = doubled.flatMap(i->ListX.of(i+1));
    
    import cyclops.monads.Witness.list;
    import cyclops.monads.Witness.optional;
    
    Nested<list,optional,Integer> listOfOptionalInt = Nested.of(ListX.of(Optionals.OptionalKind.of(2)),ListX.Instances.definitions(),Optionals.Instances.definitions());
    //Nested[List[Optional[2]]]
    
     Nested<list,optional,Integer> listOfOptionalInt;  //Nested[List[Optional[2]]]
    Nested<list,optional,Integer> doubled = listOfOptionalInt.map(i->i*2);
    //Nested[List[Optional[4]]]
    
    

    Unfoldable type class

    The unfoldable type class allows types to be recursively expanded (e.g. to generate a List from a function)

      Unfoldable<list> unfoldable = ListX.Instances.unfoldable();
      ListX<Integer> unfolded = unfoldable.unfold(1,i->i<=6 ? Optional.of(Tuple.tuple(i,i+1)) : Optional.empty());
     //(1,2,3,4,5)
    
    

    Yoneda, Coyoneda and Cofree data types

    Coyoneda allows you use custom data types as if they were Functors with Free (without having to define a custom Functor), simplifying some of the machinery required to use the Free Monad.

    Functor<Higher<Higher<coyoneda, Command>, Void>> commandFunctor  = Coyoneda.functor();
    val lifted = Free.liftF(new MyCommand<>(a, null), commandFunctor);
    

    Changelog

    Check out the features delivered and bugs fixed -

    github 2.0.0-FINAL issues & PRs github 2.0.0-RC8 issues & PRs github 2.0.0-RC1 issues & PRs

    Dependency upgrades

    None this time

    Get cyclops-react

    Gradle

    compile 'com.aol.simplereact:cyclops-react:2.0.0-FINAL’
    

    Maven

    <dependency>
        <groupId>com.aol.simplereact</groupId>
        <artifactId>cyclops-react</artifactId>
        <version>2.0.0-FINAL</version>
    </dependency>
    

    Documentation

    Articles

    Old simple-react landing page

    License

    cyclops-react is licensed under the Apache 2.0 license.

    http://www.apache.org/licenses/LICENSE-2.0#

    Source code(tar.gz)
    Source code(zip)
  • v2.0.0-MI7(Jun 6, 2017)

    2.0.0-MI7 of cyclops-react

    What’s new cyclops-react v2 Milestone 7?

    • Kotlin style sequence generators
    • Bug fixes

    Some Examples

    #e.g. with suspend and yield operators - note providing a BooleanSupplier indicates the suspended block should be executed until false (in this case infinitely).

    int i = 100;
    ReactiveSeq.generate(suspend(infinitely(),s->s.yield(i++)))
               .take(6)
               .printOut();
    
    /**
    100
    101§
    102
    103
    104
    105
    106
    **/
    

    Execute the suspended block just once (itself meaningless unless we can also sequence actions)

    int i = 100;
    ReactiveSeq.generate(suspend(s->s.yield(i++)))
               .take(6)
               .printOut();
    
    /**
    100
    **/
    

    Yield a sequence of values

    ReactiveSeq.generate(suspend(times(10),s-> {
                System.out.println("Top level - should repeat after sequence completes!");
                return s.yield(1,
                               () -> s.yield(2),
                               () -> s.yield(3),
                               () -> s.yield(4));
                           }))
               .take(6)
               .printOut();    
    

    Support method references

    Generator<Integer> generator = suspendRef(times(10),this::next);
    generator.stream()
             .forEach(System.out::println);
    
    List<Integer> list = generator.to()
                                  .linkedListX(LAZY)
                                  .type(VavrTypes.list())
                                  .map(this::process)          
                                  .to(VavrConverters::LIST);
    public Integer next(){
            return i++;
    }
    int i = 100;
    

    Method references directly during yielding

    ReactiveSeq.generate(suspend(times(10),s-> {
                        System.out.println("Top level - should repeat after sequence completes!");
                        return s.yieldRef(1,
                                          Generator::next,
                                          Generator::next,
                                          Generator::next,
                                          Generator::next);
                    }
            )).take(6)
              .printOut();
    public Integer next(){
            return i++;
    }
    

    More managable / complex mutable state via Inner Classes (if really needed)

    ReactiveSeq.<Integer>generate(suspend(times(10),new ContFunction<Integer>() {
                        int runningTotal =0;
    
                       @Override
                       public Generator<Integer> apply(Suspended<Integer> s) {
                           System.out.println("Top level - should repeat after sequence completes!");
                           return s.yield(1,
                                   () -> {
                                        runningTotal = runningTotal +5;
                                        return s.yield(runningTotal+2);
                                   },
                                   () -> s.yield(runningTotal+3),
                                   () -> s.yield(runningTotal+6));
    
                       }
                   }
    
            )).take(6)
              .printOut();
    

    Control looping based on current value and support safe (s.maybe()) and unsafe (s.current()) to the current value.

    ReactiveSeq.generate(suspend((Integer i)->i==4,s-> {
                        System.out.println("Top level - repeat infinetely after sequence (because we return 4!)");
                        return s.yield(1,
                                () -> s.yield(s.maybe()
                                                .map(o->o+5)
                                                .orElse(10)),
                                () -> s.yield(s.current()),
                                () -> s.yield(4));
                    }
            )).take(120)
              .printOut();
    

    Supporting nested generators would allow very fine control over generating data sources..

      ReactiveSeq.generate(suspend((Integer i)->i!=4, s-> {
                  
                        
                        Generator<Integer> gen1 = suspend(times(5),
                                s2->s2.yield(i++));
                        Generator<Integer> gen2 = suspend(times(2),
                                    s2->s2.yield(k--));
                        
                        return s.yieldAll(gen1.stream(),
                                gen2.stream());
                    }
            )).take(12)
                    .printOut();
    

    Changelog

    Check out the features delivered and bugs fixed -

    github 2.0.0-MI7 issues & PRs

    Dependency upgrades

    None this time

    Get cyclops-react

    Gradle

    compile 'com.aol.simplereact:cyclops-react:2.0.0-MI7’
    

    Maven

    <dependency>
        <groupId>com.aol.simplereact</groupId>
        <artifactId>cyclops-react</artifactId>
        <version>2.0.0-MI7</version>
    </dependency>
    

    Documentation

    Articles

    Old simple-react landing page

    License

    cyclops-react is licensed under the Apache 2.0 license.

    http://www.apache.org/licenses/LICENSE-2.0#

    Source code(tar.gz)
    Source code(zip)
  • v2.0.0-MI6(May 26, 2017)

    2.0.0-MI6 of cyclops-react

    What’s new cyclops-react v2 Milestone 6?

    • Xtended collections easy unwrapping and conversions
    • Better 3rd party support for Xtended Collections
    • API enhancements
    • Package reorganization to make it easier to find features
    • Unrestricted - a simplified version of Free
    • AnyM retains reactive nature for reactive monads
    • Easy conversion and extraction from Monad Transformers
    • Other enhancements and bug fixes

    Some Examples

    Unwrapping Xtended types

    LinkedList<Integer> list1 = ListX.of(1,2,3)
                                     .toConverters::LinkedList);
    

    3rd party support for Xtended Collections

    VectorX<Integer> list1 = VectorX.of(1,2,3)
    			        .type(VavrTypes.vector());
    

    Changelog

    Check out the features delivered and bugs fixed -

    github 2.0.0-MI6 issues & PRs

    Dependency upgrades

    None this time

    Get cyclops-react

    Gradle

    compile 'com.aol.simplereact:cyclops-react:2.0.0-MI6’
    

    Maven

    <dependency>
        <groupId>com.aol.simplereact</groupId>
        <artifactId>cyclops-react</artifactId>
        <version>2.0.0-MI6</version>
    </dependency>
    

    Documentation

    Articles

    Old simple-react landing page

    License

    cyclops-react is licensed under the Apache 2.0 license.

    http://www.apache.org/licenses/LICENSE-2.0#

    Source code(tar.gz)
    Source code(zip)
  • v2.0.0-MI5(Apr 26, 2017)

    2.0.0-MI5 of cyclops-react

    What’s new cyclops-react v2 Milestone 5?

    • Asynchronous caching for Functions
    • Performance improvement for combinations
    • More efficient use of Queues in FutureStreams
    • Other enhancements and bug fixes

    Changelog

    Check out the features delivered and bugs fixed -

    github 2.0.0-MI5 issues & PRs

    Dependency upgrades

    None this time

    Get cyclops-react

    Gradle

    compile 'com.aol.simplereact:cyclops-react:2.0.0-MI5’
    

    Maven

    <dependency>
        <groupId>com.aol.simplereact</groupId>
        <artifactId>cyclops-react</artifactId>
        <version>2.0.0-MI5</version>
    </dependency>
    

    Documentation

    Articles

    Old simple-react landing page

    License

    cyclops-react is licensed under the Apache 2.0 license.

    http://www.apache.org/licenses/LICENSE-2.0#

    Source code(tar.gz)
    Source code(zip)
  • v2.0.0-MI4(Feb 22, 2017)

    2.0.0-MI4 of cyclops-react

    What’s new cyclops-react v2 Milestone 4?

    New Monads and types for working with Monads

    • Kleisli
    • Cokleisli
    • Writer
    • State
    • ReaderWriterState

    Kleisli example

    Define a function that creates a Stream

    
    import cyclops.monads.Witness.reactiveSeq;
    
    
    
    Kleisli<reactiveSeq, Integer, Integer> k1 = t -> ReactiveSeq.iterate(0,i->i<t, i->i+1)
                                                                .anyM();
    
    k1.flatMap(i-> t-> ReactiveSeq.of(t+i)
                                  .anyM())
      .apply(10)
      .forEach(System.out::println);
    
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    

    Changelog

    Check out the features delivered and bugs fixed -

    github 2.0.0-MI4 issues & PRs

    Dependency upgrades

    None this time

    Get cyclops-react

    Gradle

    compile 'com.aol.simplereact:cyclops-react:2.0.0-MI4’
    

    Maven

    <dependency>
        <groupId>com.aol.simplereact</groupId>
        <artifactId>cyclops-react</artifactId>
        <version>2.0.0-MI4</version>
    </dependency>
    

    Documentation

    Articles

    Old simple-react landing page

    License

    cyclops-react is licensed under the Apache 2.0 license.

    http://www.apache.org/licenses/LICENSE-2.0#

    Source code(tar.gz)
    Source code(zip)
  • 2.0.0-MI3(Feb 6, 2017)

    2.0.0-MI3 of cyclops-react

    What’s new cyclops-react v2 Milestone 3?

    MI3 of v2 introduces a new push based / event driven ReactiveSeq implementation. Push based Streams can be created via the Spouts Factory class and can operate either in non-blocking Backpressure aware (reactive-streams) or back pressure free mode.

    In addition core cyclops-react functional types including :- Maybe, Either, Either3, Either4, Either5, Eval, ListX, SetX, SortedSetX, QueueX, DequeX, PStackX, PVectorX, PSetX, POrderedSetX, PQueueX, PBagX can all operate as non-blocking reactive types (alongside Future and FutureStream).

    A host of new operators have been added including : fanOut, parallelFanOut, Java 9 style iterate, deferred, ofNullable, multicast, broadcast, publishTo, changes, ambWith, findOne, firstOrError and more.

    New types introduced include MaybeT, OptionalT, EvalT, CompletableFutureT, StreamT type safe, higher kinded monad transformers

    • ReactiveSeq supports non-blocking push based Streams
    
       ReactiveSeq<Integer> input = Spouts.async(subscriber->{
           
                                                   listener.onEvent(subscriber::onNext);
                                                          
                                                  listener.onError(susbscriber::onError);
                                                                                                        
                                                  closeListener.onEvent(subscriber::onClose);
 
                                                         });
    
    input.map(this::process)
         .forEach(this::handleResult,this::handleError,this::finish);
    
    
    
    • And non-blocking backpressure via reactive-streams for asynchronous and synchronous Streams
    
    ReactiveSeq<Integer> input = Spouts.publishOn(ReactiveSeq.of(1,2,3),
                                                  Executors.newFixedThreadPool(1));
    
    Subscription sub = input.map(this::process)
                            .subscribe(this::handleResult,this::handleError,this::finish);
    
    sub.request(2);
    
    
    
    • An array of non-blocking Reactive Types

    Collections

    
    ReactiveSeq<Integer> input = Spouts.publishOn(ReactiveSeq.of(1,2,3),
                                                  Executors.newFixedThreadPool(1));
    
    ListX<Integer> res = input.map(this::process)
                          .toListX();
    
    this.continueProcessing();
    currentThreadIsNotBlocked();
    
    Integer thisBlocksThough = res.get(5);
    
    //ListX, SetX, DequeX, QueueX, QueueX and persistent analogs populated asynchronously, without blocking the current Thread
    
    
    
    
    

    Maybe

    
    
    ReactiveSeq<Integer> input = Spouts.publishOn(ReactiveSeq.of(1,2,3),
                                                  Executors.newFixedThreadPool(1));
    
    Maybe<Integer> res = input.map(this::process)
                          .findOne();
    
    //Maybe populated asynchronously and without blocking the current thread.
    
    

    Either

    
    
    ReactiveSeq<Integer> input = Spouts.publishOn(ReactiveSeq.of(1,2,3),
                                                  Executors.newFixedThreadPool(1));
    
    Either<Throwable,Integer> = input.map(this::process)
                                     .findFirstOrError();
    
    //Either populated asynchronously and without blocking the current thread.
    
    

    And more!

    Eval, Either3-5, ListX,SetX,QueueX,DequeX,SortedSetX,PStackX,PVectorX,PQueueX,PSetX,POrderedSetX,PBagX

    Completable Types

    2.0.0-MI3 introduces CompletableMaybe, CompletableEval and CompletableEither(3-5). Completable types allow a dataflow to be defined and completed asynchronously.

    
    //create a CompletableEither
    CompletableEither<Integer,Integer> completable = Either.either();

    //define the data flow
    Either<Throwable,Integer> mapped = completable.map(i->i*2)
                                  
                                                  .flatMap(i->Eval.later(()->i+1));

    
    //potentially asynchronously / on another thread push a value into the Either
    
completable.complete(5);

    
    //execute the dataflow and printout

    mapped.printOut();
assertThat(mapped.get(),equalTo(11));
    
    //or connect to another reactive type asynchronously
    Spouts.from(mapped)
          .forEach(this::continueProcessing,this::handleErrors);
    
    

    Changelog

    Check out the features delivered and bugs fixed -

    github 2.0.0-MI3 issues & PRs

    Dependency upgrades

    None this time

    Get cyclops-react

    Gradle

    compile 'com.aol.simplereact:cyclops-react:2.0.0-MI3’
    

    Maven

    <dependency>
        <groupId>com.aol.simplereact</groupId>
        <artifactId>cyclops-react</artifactId>
        <version>2.0.0-MI3</version>
    </dependency>
    

    Documentation

    Articles

    Old simple-react landing page

    License

    cyclops-react is licensed under the Apache 2.0 license.

    http://www.apache.org/licenses/LICENSE-2.0#

    Source code(tar.gz)
    Source code(zip)
  • v2.0.0-MI1(Jan 7, 2017)

    2.0.0-MI1 of cyclops-react

    What’s new cyclops-react v2?

    • ReactiveSeq is replayable
    ReactiveSeq<Integer> range = ReactiveSeq.range(0,1);
    range.forEach(System.out::println);
    range.map(this::process).forEach(System.out::println);
    
    • Collections are lazy
    ListX<Data> load = ListX.of(1,2,3)
                            .map(i->i*2)
                            .filter(i->i<3)
                            .map(this::lookup);
    

    Unlike most other functional style collection implementations load is a lazy refernce and the dataflow is only executed (once) on initial access. This gives much better performance for chained dataflows as the collection is traversed only once.

    • Streaming engine behind ReactiveSeq rewritten from scratch to be both replayable and ultra-efficient
    • Parralel sections within a sequential Stream
    ReactiveSeq.generate(this::nextValue)
               .map(this::process)
               .parallel(new ForkJoinPool(10), 
                         par->par.map(this::cpuIntensiveOp)
                                 .filter(this::accept))
               .forEach(this::store);
    

    The parallel section is executed in parallel, the rest executed sequentially

    • Free Monad implementation for functional interpreters
    • Type safe, higher kinded AnyM implementation using Witness types
    AnyM<optional,Integer> opt = by2(AnyM.ofNullable(10));
    AnyM<stream,Integer> stream = by2(AnyM.fromArray(10,20,30));
    
    Stream<Integer> rawStream = stream.to(Witness::stream);
    Optional<Integer> rawOptional = opt.to(Witness::optional);
    
    public <W extends WitnessType<W>> AnyM<W,Integer> by2(AnyM<W,Integer> toMultiply){
    
       return toMultiply.map(i->i*2);
    
    }
    
    • Lazy tail recursive Either implementations (Either through Either5)
    • Higher kinded types for core cyclops-react types
    • Higher kinded type classes fro core cyclops-react types
    • Interface rationalization - more focused types, better naming

    e.g. LazyFutureStream becomes FutureStream

    Still to come (work in progress)

    • Pure push sequential ReactiveSeq implementation
    ReactiveSubscriber<Integer> pushable = ReactiveSeq.pushable();
ReactiveSeq<Integer> stream = pushable.stream();
    
    stream.map(i->i*2)
          .forEach(System.out::println);
    
    pushable.onNext(10);
    
    //20
    
    

    See cyclops.StreamSource to push data into pull based sequential Streams.

    Changelog

    Check out the features delivered and bugs fixed -

    github 2.0.0-MI1 issues & PRs

    Dependency upgrades

    Agrona to 0.9.1 Jooλ to 0.9.12

    Get cyclops-react

    Gradle

    compile 'com.aol.simplereact:cyclops-react:2.0.0-MI1’
    

    Maven

    <dependency>
        <groupId>com.aol.simplereact</groupId>
        <artifactId>cyclops-react</artifactId>
        <version>2.0.0-MI1</version>
    </dependency>
    

    Documentation

    Articles

    Old simple-react landing page

    License

    cyclops-react is licensed under the Apache 2.0 license.

    http://www.apache.org/licenses/LICENSE-2.0#

    Source code(tar.gz)
    Source code(zip)
LWJGL is a Java library that enables cross-platform access to popular native APIs useful in the development of graphics (OpenGL, Vulkan), audio (OpenAL), parallel computing (OpenCL, CUDA) and XR (OpenVR, LibOVR) applications.

LWJGL - Lightweight Java Game Library 3 LWJGL (https://www.lwjgl.org) is a Java library that enables cross-platform access to popular native APIs usef

Lightweight Java Game Library 4k Dec 29, 2022
Eclipse Collections is a collections framework for Java with optimized data structures and a rich, functional and fluent API.

English | 中文 | Deutsch | Español | Ελληνικά | Français | 日本語 | Norsk (bokmål) | Português-Brasil | Русский | हिंदी Eclipse Collections is a comprehens

Eclipse Foundation 2.1k Dec 29, 2022
Clojure's data structures modified for use outside of Clojure

This library has been extracted from the master branch of Clojure (http://clojure.org) version 1.5.1 (as of October 2013) http://github.com/richhick

Karl Krukow 221 Oct 6, 2022
Library for creating In-memory circular buffers that use direct ByteBuffers to minimize GC overhead

Overview This project aims at creating a simple efficient building block for "Big Data" libraries, applications and frameworks; thing that can be used

Tatu Saloranta 132 Jul 28, 2022
Immutable key/value store with efficient space utilization and fast reads. They are ideal for the use-case of tables built by batch processes and shipped to multiple servers.

Minimal Perfect Hash Tables About Minimal Perfect Hash Tables are an immutable key/value store with efficient space utilization and fast reads. They a

Indeed Engineering 92 Nov 22, 2022
Table-Computing (Simplified as TC) is a distributed light weighted, high performance and low latency stream processing and data analysis framework. Milliseconds latency and 10+ times faster than Flink for complicated use cases.

Table-Computing Welcome to the Table-Computing GitHub. Table-Computing (Simplified as TC) is a distributed light weighted, high performance and low la

Alibaba 34 Oct 14, 2022
High Performance data structures and utility methods for Java

Agrona Agrona provides a library of data structures and utility methods that are a common need when building high-performance applications in Java. Ma

Real Logic 2.5k Jan 5, 2023
Bloofi: A java implementation of multidimensional Bloom filters

Bloofi: A java implementation of multidimensional Bloom filters Bloom filters are probabilistic data structures commonly used for approximate membersh

Daniel Lemire 71 Nov 2, 2022
A high performance caching library for Java

Caffeine is a high performance, near optimal caching library. For more details, see our user's guide and browse the API docs for the latest release. C

Ben Manes 13k Jan 5, 2023
Chronicle Bytes has a similar purpose to Java NIO's ByteBuffer with many extensions

Chronicle-Bytes Chronicle-Bytes Chronicle Bytes contains all the low level memory access wrappers. It is built on Chronicle Core’s direct memory and O

Chronicle Software : Open Source 334 Jan 1, 2023
High performance Java implementation of a Cuckoo filter - Apache Licensed

Cuckoo Filter For Java This library offers a similar interface to Guava's Bloom filters. In most cases it can be used interchangeably and has addition

Mark Gunlogson 161 Dec 30, 2022
External-Memory Sorting in Java

Externalsortinginjava External-Memory Sorting in Java: useful to sort very large files using multiple cores and an external-memory algorithm. The vers

Daniel Lemire 235 Dec 29, 2022
Geohash utitlies in java

geo Java utility methods for geohashing. Status: production, available on Maven Central Maven site reports are here including javadoc. Add this to you

Dave Moten 386 Jan 1, 2023
Hollow is a java library and toolset for disseminating in-memory datasets from a single producer to many consumers for high performance read-only access.

Hollow Hollow is a java library and toolset for disseminating in-memory datasets from a single producer to many consumers for high performance read-on

Netflix, Inc. 1.1k Dec 25, 2022
High Performance Primitive Collections for Java

HPPC: High Performance Primitive Collections Collections of primitive types (maps, sets, stacks, lists) with open internals and an API twist (no java.

Carrot Search 890 Dec 28, 2022
Java port of a concurrent trie hash map implementation from the Scala collections library

About This is a Java port of a concurrent trie hash map implementation from the Scala collections library. It is almost a line-by-line conversion from

null 147 Oct 31, 2022
Java library for the HyperLogLog algorithm

java-hll A Java implementation of HyperLogLog whose goal is to be storage-compatible with other similar offerings from Aggregate Knowledge. NOTE: This

Aggregate Knowledge (a Neustar service) 296 Dec 30, 2022
A simple integer compression library in Java

JavaFastPFOR: A simple integer compression library in Java License This code is released under the Apache License Version 2.0 http://www.apache.org/li

Daniel Lemire 487 Dec 30, 2022