Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Kliesli wrapper for working with Monadic Functions #509

Closed
johnmcclean opened this issue Feb 3, 2017 · 2 comments
Closed

Add Kliesli wrapper for working with Monadic Functions #509

johnmcclean opened this issue Feb 3, 2017 · 2 comments
Milestone

Comments

@johnmcclean
Copy link
Member

(Functions that return a monadic type -> e.g. see #255)

@johnmcclean
Copy link
Member Author

johnmcclean commented Feb 6, 2017

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

@johnmcclean
Copy link
Member Author

Releaed in 2.0.0-MI4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant