Commit 49a8af14 authored by pysaumont's avatar pysaumont
Browse files

Fixes after AC review for chapter 12

parent 08fbf7be
......@@ -38,5 +38,5 @@ public interface Random<A> extends Function<RNG, Tuple<A, RNG>> {
Random<Tuple<Integer, Integer>> intPairRnd = map2(intRnd, intRnd, x -> y -> new Tuple<>(x, y));
Function<Integer, Random<List<Integer>>> integersRnd = length -> sequence(List.fill(length, () -> intRnd));
Function<Integer, Random<List<Integer>>> integersRnd = null; // to be implemented
}
......@@ -47,7 +47,7 @@ public interface Random<A> extends Function<RNG, Tuple<A, RNG>> {
Random<Integer> notMultipleOfFiveRnd = Random.flatMap(intRnd, x -> {
int mod = x % 5;
return mod != 0
? unit(mod)
? unit(x)
: Random.notMultipleOfFiveRnd;
});
}
......@@ -18,7 +18,7 @@ public class Random<A> extends State<RNG, A> {
public static State<RNG, Integer> notMultipleOfFiveRnd = intRnd.flatMap(x -> {
int mod = x % 5;
return mod != 0
? unit(mod)
? unit(x)
: Random.notMultipleOfFiveRnd;
});
......
......@@ -54,7 +54,7 @@ public interface Random<A> extends Function<RNG, Tuple<A, RNG>> {
Random<Integer> notMultipleOfFiveRnd = Random.flatMap(intRnd, x -> {
int mod = x % 5;
return mod != 0
? unit(mod)
? unit(x)
: Random.notMultipleOfFiveRnd;
});
}
......@@ -47,7 +47,7 @@ public interface Random<A> extends Function<RNG, Tuple<A, RNG>> {
Random<Integer> notMultipleOfFiveRnd = Random.flatMap(intRnd, x -> {
int mod = x % 5;
return mod != 0
? unit(mod)
? unit(x)
: Random.notMultipleOfFiveRnd;
});
}
......@@ -18,7 +18,7 @@ public class Random<A> extends State<RNG, A> {
public static State<RNG, Integer> notMultipleOfFiveRnd = intRnd.flatMap(x -> {
int mod = x % 5;
return mod != 0
? unit(mod)
? unit(x)
: Random.notMultipleOfFiveRnd;
});
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment