From a0d8c8066faadaf609e151ed0b71235a9615584a Mon Sep 17 00:00:00 2001 From: Carlo Zancanaro Date: Mon, 1 Jun 2015 12:49:53 +1000 Subject: Rename fmap -> map (apparently that's what Java's going with, see java.util.Optional) --- src/main/java/au/id/zancanaro/javacheck/RoseTree.java | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'src/main/java/au/id/zancanaro/javacheck/RoseTree.java') diff --git a/src/main/java/au/id/zancanaro/javacheck/RoseTree.java b/src/main/java/au/id/zancanaro/javacheck/RoseTree.java index 4d7b770..86952da 100644 --- a/src/main/java/au/id/zancanaro/javacheck/RoseTree.java +++ b/src/main/java/au/id/zancanaro/javacheck/RoseTree.java @@ -2,10 +2,7 @@ package au.id.zancanaro.javacheck; import java.io.IOException; import java.io.Writer; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Iterator; -import java.util.List; +import java.util.*; import java.util.function.Function; import java.util.function.Predicate; @@ -90,14 +87,14 @@ public class RoseTree { RoseTree.removeEach(trees))); } - public RoseTree fmap(Function f) { + public RoseTree map(Function f) { return new RoseTree<>( f.apply(this.value), - () -> Iterators.mappingIterator(tree -> tree.fmap(f), this.children.iterator())); + () -> Iterators.mappingIterator(tree -> tree.map(f), this.children.iterator())); } - public RoseTree flatmap(Function> f) { - return RoseTree.join(this.fmap(f)); + public RoseTree flatMap(Function> f) { + return RoseTree.join(this.map(f)); } public RoseTree filter(Predicate predicate) { -- cgit v1.2.3