Re: Either left() vs left(value)

2015-11-24 Thread Gyula Fóra
I opened a PR: https://github.com/apache/flink/pull/1402 with my suggestions, let me know what you think and we can either merge this or leave it as it is :) I would also like to hear the opinions of others about this. Vasiliki Kalavri ezt írta (időpont: 2015. nov. 23., H, 22:03): > Either is

Re: Either left() vs left(value)

2015-11-23 Thread Vasiliki Kalavri
Either is abstract already ;) On 23 November 2015 at 21:54, Gyula Fóra wrote: > I think it is not too bad to only have the Right/Left classes. You can then > write it like this: > > Either e1 = new Left<>(""); > Either e2 = new Right<>(1); > > (this would be pretty much like in scala) > > or we

Re: Either left() vs left(value)

2015-11-23 Thread Gyula Fóra
I think it is not too bad to only have the Right/Left classes. You can then write it like this: Either e1 = new Left<>(""); Either e2 = new Right<>(1); (this would be pretty much like in scala) or we can add static methods like: Left.of(...), Right.of(...) which would work exactly as it does now

Re: Either left() vs left(value)

2015-11-23 Thread Vasiliki Kalavri
Ah I see. Well, as I also said in the PR, Left and Right make no sense on their own, they're helper classes for Either. Hence, I believe they should be private. Maybe we could rename the methods to createLeft() / createRight() ? On 23 November 2015 at 20:58, Gyula Fóra wrote: > I was actually no

Re: Either left() vs left(value)

2015-11-23 Thread Gyula Fóra
I was actually not suggesting to drop the e.left() method but instead the Either.left(val). Renaming the left(), right() methods might be confusing as than it would be inconsistent with the scala version. On the other hand we could change the way the user can create the Left Right classes, maybe d

Re: Either left() vs left(value)

2015-11-23 Thread Vasiliki Kalavri
Hey Gyula, I don't think dropping the method is a good idea. We need a way to retrieve left and right values, no? How about renaming to getLeft() / getRight()? -V. On 23 November 2015 at 09:55, Gyula Fóra wrote: > Hey guys, > > I know this should have been part of the PR discussion but it kind

Either left() vs left(value)

2015-11-23 Thread Gyula Fóra
Hey guys, I know this should have been part of the PR discussion but it kind of slipped through the cracks :) I think it might be useful to change the method name for Either.left(value) to Either.Left(value) (or drop the method completely). The reason is that it is slightly awkward to use it wit