You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: cyclops-rxjava2/readme.md
+76-3Lines changed: 76 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -467,11 +467,84 @@ System.out.println(anyM);
467
467
```
468
468
469
469
470
-
#Higher Kinded Types and Type classes
470
+
## Using Typeclasses
471
471
472
-
If you really want / or need to program at a much higher level of abstraction cyclops-rx provided psuedo Higher Kinded encordings and typeclasses for Observables, Flowables, Singles and Maybes
472
+
### Directly
473
473
474
-
e.g. using the Pure and Functor typeclasses for Vavr Streams
474
+
Typeclasses can be used directly (although this results in verbose and somewhat cumbersome code)
475
+
e.g. using the Pure and Functor typeclasses for Observable
476
+
477
+
```java
478
+
479
+
Pure<observable> pure =Observables.Instances.unit();
The Active class represents a Higher Kinded encoding of a Reactor (or cyclops-react/ JDK/ Vavr / rx etc) type *and* it's associated type classes
493
+
494
+
The code above which creates a new Flux containing a single element "hello" and transforms it to a Flux of Integers (the length of each word), can be written much more succintly with Active
495
+
496
+
```java
497
+
498
+
Active<observable,Integer> active =Observables.allTypeClasses(Flux.empty());
0 commit comments