We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1db219c commit fdcadccCopy full SHA for fdcadcc
src/main/java/com/jnape/palatable/lambda/monoid/builtin/Present.java
@@ -27,6 +27,8 @@
27
*/
28
public final class Present<A> implements MonoidFactory<Semigroup<A>, Maybe<A>> {
29
30
+ private static final Present INSTANCE = new Present<>();
31
+
32
private Present() {
33
}
34
@@ -36,8 +38,9 @@ public Monoid<Maybe<A>> apply(Semigroup<A> aSemigroup) {
36
38
nothing());
37
39
40
41
+ @SuppressWarnings("unchecked")
42
public static <A> Present<A> present() {
- return new Present<>();
43
+ return INSTANCE;
44
45
46
public static <A> Monoid<Maybe<A>> present(Semigroup<A> semigroup) {
0 commit comments