Functional Java: importing from Maven

126 Views Asked by At

I have cloned a maven project on a new machine but I am having some problems with some of the dependencies as they don't seem to have been loaded. One such case, is fj.Effect of Functional java. I am not sure if I am (manually) adding the right library.

In the code, I have:

private Effect<EventDBEvent> downloadEvent = new Effect<EventDBEvent>() {
    @Override
    public void e(EventDBEvent eventDBEvent) {
        ...
    }
};

I have tried adding org.org.functionaljava:functionaljava-java8:4.32 and org.functionaljava:functionaljava:4.3 IntelliJ recognizes Effect but highlights the first line as error and says: I have a similar issue in another line:

final ... = new ...(new Effect<Option<Integer>>() {
    @Override
    public void e(Option<Integer> integerOption) {
    }
}, ...);

Type fj.Effect does not have type parameters.

Am I importing the wrong packages?

More generally, is there a way of knowing which packages I should use, based on an existing code?

1

There are 1 best solutions below

0
On

The Effect class changed so that the arity is in the class name, e.g. Effect0, Effect1, etc., where the arity indicates the number of parameters to the method. You want to use the Effect1 class.