Skip to content

Commit 49a8af1

Browse files
committed
Fixes after AC review for chapter 12
1 parent 08fbf7b commit 49a8af1

6 files changed

Lines changed: 6 additions & 6 deletions

File tree

fpinjava-parent/fpinjava-state-exercises/src/main/java/com/fpinjava/state/exercise12_06/Random.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,5 @@ static <A> Random<List<A>> sequence(List<Random<A>> rs) {
3838

3939
Random<Tuple<Integer, Integer>> intPairRnd = map2(intRnd, intRnd, x -> y -> new Tuple<>(x, y));
4040

41-
Function<Integer, Random<List<Integer>>> integersRnd = length -> sequence(List.fill(length, () -> intRnd));
41+
Function<Integer, Random<List<Integer>>> integersRnd = null; // to be implemented
4242
}

fpinjava-parent/fpinjava-state-exercises/src/main/java/com/fpinjava/state/exercise12_08/Random.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ static <A, B> Random<B> flatMap(Random<A> s, Function<A, Random<B>> f) {
4747
Random<Integer> notMultipleOfFiveRnd = Random.flatMap(intRnd, x -> {
4848
int mod = x % 5;
4949
return mod != 0
50-
? unit(mod)
50+
? unit(x)
5151
: Random.notMultipleOfFiveRnd;
5252
});
5353
}

fpinjava-parent/fpinjava-state-exercises/src/main/java/com/fpinjava/state/exercise12_09/Random.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public Random(Function<RNG, Tuple<A, RNG>> run) {
1818
public static State<RNG, Integer> notMultipleOfFiveRnd = intRnd.flatMap(x -> {
1919
int mod = x % 5;
2020
return mod != 0
21-
? unit(mod)
21+
? unit(x)
2222
: Random.notMultipleOfFiveRnd;
2323
});
2424

fpinjava-parent/fpinjava-state-solutions/src/main/java/com/fpinjava/state/exercise12_07/Random.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ static <A, B> Random<B> flatMap(Random<A> s, Function<A, Random<B>> f) {
5454
Random<Integer> notMultipleOfFiveRnd = Random.flatMap(intRnd, x -> {
5555
int mod = x % 5;
5656
return mod != 0
57-
? unit(mod)
57+
? unit(x)
5858
: Random.notMultipleOfFiveRnd;
5959
});
6060
}

fpinjava-parent/fpinjava-state-solutions/src/main/java/com/fpinjava/state/exercise12_08/Random.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ static <A, B> Random<B> flatMap(Random<A> s, Function<A, Random<B>> f) {
4747
Random<Integer> notMultipleOfFiveRnd = Random.flatMap(intRnd, x -> {
4848
int mod = x % 5;
4949
return mod != 0
50-
? unit(mod)
50+
? unit(x)
5151
: Random.notMultipleOfFiveRnd;
5252
});
5353
}

fpinjava-parent/fpinjava-state-solutions/src/main/java/com/fpinjava/state/exercise12_09/Random.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public Random(Function<RNG, Tuple<A, RNG>> run) {
1818
public static State<RNG, Integer> notMultipleOfFiveRnd = intRnd.flatMap(x -> {
1919
int mod = x % 5;
2020
return mod != 0
21-
? unit(mod)
21+
? unit(x)
2222
: Random.notMultipleOfFiveRnd;
2323
});
2424

0 commit comments

Comments
 (0)