Cyclops X Milestone 7 : JSON Serialization / Deserialization
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 -
Dependency changes
None this release
Modules
- cyclops - Persistent data structures and control types
- cyclops-futurestream - Parrallel asynchronous streaming
- cyclops-reactive-collections - Fast, non-blocking, asynchronous extensions for JDK and Persistent Collections
- cyclops-anyM - Higher kinded abstractions for working with any Java Monad type.
- cyclops-pure - Higher kinded type classes for pure functional programming in Java
- cyclops-reactor-integration - Reactive collections and AnyM integrations with Reactor.
- cyclops-rxjava2-integration - Reactive collections and AnyM integrations with Rx Java 2.
- cyclops-rxjava-integration - Reactive collections and AnyM integrations with Rx Java.
- cyclops-vavr-integration - Reactive collections and AnyM integrations with Vavr.
- cyclops-jackson-integration - Jackson databindings for Cyclops persistent data structures and control types.
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
- Reactive programming with Java 8 and simple-react: The Tutorial
- JDK Collection eXtensions
- Awesome Fluent Functions
- Straightforward Structural Pattern Matching
- Performant Functional Try
- Articles on medium
- Introducting the Cyclops Monad API
- Easier Try with Cyclops
- 4 flavors of Java 8 Functions
- Memoise Functions in Java 8
- Strategy Pattern in Java 8
- Functional Feature Toggling
- Dependency injection using the Reader Monad in Java8
- Scheduling a Stream
- Neophytes guide to Java 8 : Welcome to the Future
- Deterministic and Non-Deterministic Finite State Machines with Cyclops
License
cyclops-react is licensed under the Apache 2.0 license.