It would be desirable, if we could declare a monadic return type on Rewriter::rewrite with a type parameter, M<P2>; and then use, e.g., the identity monad for normalizers, the list monad for forward mappers, the maybe monad java.util.Optional for reverse mappers.
However, that cannot be expressed in the Java type system. Can it?
That does not compile:
public interface Rewriter<M<?>, R extends Resource<?>, P1 extends Point, P2 extends Point> {
public M<P2> rewrite(R resource, P1 position, RewriterConfig config) throws SelectorException;
}
Assignees: @lueck
Migrated from GitLab: https://zivgitlab.uni-muenster.de/SCDH/selectors/selection-engine/-/issues/14
It would be desirable, if we could declare a monadic return type on
Rewriter::rewritewith a type parameter,M<P2>; and then use, e.g., the identity monad for normalizers, the list monad for forward mappers, the maybe monadjava.util.Optionalfor reverse mappers.However, that cannot be expressed in the Java type system. Can it?
That does not compile:
Assignees: @lueck
Migrated from GitLab: https://zivgitlab.uni-muenster.de/SCDH/selectors/selection-engine/-/issues/14