From 18aa6406ef555c44beff3c0bfcfd8c10ac30224e Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Tue, 26 Jun 2018 07:19:39 +0100 Subject: [PATCH] Result extends Functor --- src/main/java/net/kemitix/mon/result/Result.java | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/main/java/net/kemitix/mon/result/Result.java b/src/main/java/net/kemitix/mon/result/Result.java index ea0de64..70a81e7 100644 --- a/src/main/java/net/kemitix/mon/result/Result.java +++ b/src/main/java/net/kemitix/mon/result/Result.java @@ -21,6 +21,7 @@ package net.kemitix.mon.result; +import net.kemitix.mon.Functor; import net.kemitix.mon.maybe.Maybe; import java.util.function.Consumer; @@ -35,7 +36,7 @@ import java.util.function.Supplier; * @author Paul Campbell (pcampbell@kemitix.net) */ @SuppressWarnings("methodcount") -public interface Result { +public interface Result extends Functor> { /** * Creates a Result from the Maybe, where the Result will be an error if the Maybe is Nothing. @@ -124,13 +125,7 @@ public interface Result { */ Result flatMap(Function> f); - /** - * Applies the functions to the value of a successful result, while doing nothing with an error. - * - * @param f the mapping function to produce the new value - * @param the type of the result of the mapping function - * @return a Result - */ + @Override Result map(Function f); /**