-
Notifications
You must be signed in to change notification settings - Fork 136
Interoperability
Maximizing interoperability of cyclops across the broad Java 8 eco-system and the JDK is a key component, essential to meeting the project's core goal.
## Java 8 eco-system
Very many Java classes implement Iterable (not only JDK collections but also Javaslang and Functional Java collections / value types). By both implementing Iterable on our own types and accepting Iterables as inputs within our APIs we maximize interoperability with libraries that also make use of Iterable.
The Reactive Streams API defines a standard for interoperability between data producers and data consumers. By implementing Reactive Streams Publishers across our types we ensure that libraries such as Pivotal's Reactor and RxJava 2 can reuse them out of the box. Likewise we can further maximize interoperability by accepting Publishers within our APIs too.
AnyM is a mechanism whereby we can abstract over any Java Functor and Monad types, this is done by writing once only, if neccessary, an Adapter that help cyclops execute the appropriate map and flatMap methods.
The encoding of Derive4j HKTs allows cyclops-react to accept 3rd party types encoded in such a manner into it's APIs in way that maintains full type information.
Lombok, Derive4j and Immutables can significantly reduce boiler plate code in Java - particularly when generating case classes and Algebraic Data Types. Lombok's val also helps with Java's verbosity when working with large generic signatutes.
oops - my bad