run linter
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
package cs2030s.fp;
|
||||
|
||||
/**
|
||||
* The Action interface that can be called
|
||||
* on an object of type T to act.
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
package cs2030s.fp;
|
||||
|
||||
/**
|
||||
* The Actionable interface that can
|
||||
* act when given an action.
|
||||
|
||||
@@ -1,6 +1,19 @@
|
||||
package cs2030s.fp;
|
||||
|
||||
public abstract class Actually<T> implements Immutatorable<T>, Actionable<T> {
|
||||
|
||||
public static <T> Actually<T> ok(T value) {
|
||||
return new Success<T>(value);
|
||||
}
|
||||
|
||||
public static <T> Actually<T> err(Exception e) {
|
||||
// It is okay to do an unchecked cast here as failure types don't use
|
||||
// the value T.
|
||||
@SuppressWarnings("unchecked")
|
||||
Actually<T> failure = (Actually<T>) new Failure(e);
|
||||
return failure;
|
||||
}
|
||||
|
||||
public abstract T unwrap() throws Exception;
|
||||
|
||||
public abstract T except(Constant<? extends T> c);
|
||||
@@ -11,14 +24,6 @@ public abstract class Actually<T> implements Immutatorable<T>, Actionable<T> {
|
||||
|
||||
public abstract <R> Actually<R> next(Immutator<Actually<R>, ? super T> immutator);
|
||||
|
||||
public static <T> Actually<T> ok(T value) {
|
||||
return new Success<T>(value);
|
||||
}
|
||||
|
||||
public static <T> Actually<T> err(Exception e) {
|
||||
Actually<T> failure = (Actually<T>) new Failure(e);
|
||||
return failure;
|
||||
}
|
||||
|
||||
private static class Success<T> extends Actually<T> {
|
||||
private final T value;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
package cs2030s.fp;
|
||||
|
||||
/**
|
||||
* The Immutator interface that can transform
|
||||
* to type T2, an object of type T1.
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
package cs2030s.fp;
|
||||
|
||||
/**
|
||||
* The Immutatorable interface that can
|
||||
* transform when given something that is
|
||||
|
||||
Reference in New Issue
Block a user