Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upAdditionnal facilities for partial matching #8
Comments
jbgi
added this to the 0.5 milestone
Oct 20, 2015
jbgi
added
enhancement
question
labels
Oct 20, 2015
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
talios
Oct 31, 2015
Contributor
Would otherwiseLeft and otherwiseFail only be generated for the flavours that support them, or will derive4j have a companion artefact containing an Either and Validation implementation ( hopefully not unique versions of these per @Data type..
|
Would |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
jbgi
Oct 31, 2015
Member
they would be generated only for flavours that already have those data-types.
|
they would be generated only for flavours that already have those data-types. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
+2 - sounds good. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
elucash
Nov 3, 2015
2cents: why not have overload?
Function<ADT, R> otherwise(R value);
Function<ADT, R> otherwise(Supplier<R> value);Things are only going bad if you have same erasure or ambiguous lambda parameter (Supplier<Supplier<>> ? unlikely to be used). And the symmetry is not harmed either as naming here is to accommodate return type, not input
elucash
commented
Nov 3, 2015
|
2cents: why not have overload? Function<ADT, R> otherwise(R value);
Function<ADT, R> otherwise(Supplier<R> value);Things are only going bad if you have same erasure or ambiguous lambda parameter ( |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
jbgi
Nov 3, 2015
Member
Yeah, let's try overloading. If not complaints from users' compilers we will keep it. thanks @elucash
|
Yeah, let's try overloading. If not complaints from users' compilers we will keep it. thanks @elucash |
jbgi
modified the milestones:
0.6,
0.5
Nov 10, 2015
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
jbgi
Dec 15, 2015
Member
overloading may not be a good idea, performance-wise. Current inference algo is slow in the presence of overloading: https://bugs.openjdk.java.net/browse/JDK-8051946 / http://stackoverflow.com/questions/34223249/slow-compilation-with-jooq-3-6-plain-sql-and-the-javac-compiler
I also worry that IDE code completion will be less useful.
|
overloading may not be a good idea, performance-wise. Current inference algo is slow in the presence of overloading: https://bugs.openjdk.java.net/browse/JDK-8051946 / http://stackoverflow.com/questions/34223249/slow-compilation-with-jooq-3-6-plain-sql-and-the-javac-compiler |
jbgi
closed this
in
1782eff
Dec 29, 2015
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
jbgi
Dec 29, 2015
Member
I left out otherwiseFail (Validation ), to reduce the amount of generated code (conversion from Either is easy).
I also gone the overload route. If problems arise overloads may be renamed in a later version.
|
I left out |
jbgi commentedOct 20, 2015
today there is only
I think it should be renamed into
And then we can add:
What others think about that feature? (are naming good?)