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

Return of StaticImports.xform #14

Closed
BrenoTrancoso opened this issue Jan 5, 2017 · 3 comments
Closed

Return of StaticImports.xform #14

BrenoTrancoso opened this issue Jan 5, 2017 · 3 comments
Labels

Comments

@BrenoTrancoso
Copy link

StaticImports:

public static <T> Transformable<T> xform(Iterable iterable);
public static <T> Transformable<T> xformArray(T... items);

To

public static <T> Xform<T> xform(Iterable iterable);
public static <T> Xform<T> xformArray(T... items);

@GlenKPeterson
Copy link
Owner

Thank you for your interest! What is the benefit of exposing the implementation instead of the interface? What do you need from Xform that you don't get from Transformable?

@BrenoTrancoso
Copy link
Author

xform(new ArrayList<>()).forEach(x -> {}) -> forEach doesn't exists.
Xform.of(new ArrayList<>()).forEach(x -> {}) -> forEach exists.

xform(new ArrayList()).flatMap(x -> xform(new ArrayList())) -> Type mismatch: cannot convert from Transformable to Iterable
xform(new ArrayList()).flatMap(x -> Xform.of(new ArrayList())) -> OK

Maybe to public static <T> UnmodIterable<T> xform(Iterable iterable);

@GlenKPeterson
Copy link
Owner

Thank you for finding and reporting this. I really like your suggestion to use UnmodIterable instead of Transformable and have made that change as you suggest in Paguro 2.0.16.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2 participants