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

Example of iteration #1670

Open
advasileva opened this issue Dec 10, 2022 · 4 comments
Open

Example of iteration #1670

advasileva opened this issue Dec 10, 2022 · 4 comments

Comments

@advasileva
Copy link
Contributor

In README.md there is an example in the Iterables/Collections/Lists/Sets section:

new And(
  new Mapped<>(
    new FuncOf<>(
      input -> {
        System.out.printf("Item: %s\n", input);
      }
    ),
    new IterableOf<>("how", "are", "you", "?")
  )
).value();

It does not compile with an explanation:

Missing return statement
Candidates for new FuncOf() are:  
  FuncOf(Proc<? super X> proc, Y result)
  FuncOf(Scalar<? extends Y> scalar)
  FuncOf(Func<? super X, ? extends Y> fnc)
@advasileva
Copy link
Contributor Author

It worked for me like this:

new And(
  new Mapped<>(
    new FuncOf<>(
      input -> {
        System.out.printf("Item: %s\n", input);
      },
      new True()
    ),
    new IterableOf<>("how", "are", "you", "?")
  )
).value();

@victornoel
Copy link
Collaborator

victornoel commented Dec 12, 2022

@advasileva thank you, let's then update the README and ensure all examples work.

@victornoel
Copy link
Collaborator

@0crat in

@victornoel
Copy link
Collaborator

@0crat assign @advasileva

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

3 participants