From b3bc53900fe86a3bbd38565f8d799c7b08ccc90a Mon Sep 17 00:00:00 2001 From: msinton Date: Tue, 3 Dec 2019 16:12:02 +0000 Subject: [PATCH] Fix typo (#3181) nextBoolean correctly implemented initially, then second occurrence would be false biased (ever so slightly!) --- docs/src/main/tut/datatypes/state.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/src/main/tut/datatypes/state.md b/docs/src/main/tut/datatypes/state.md index 10f9682133..eda997af15 100644 --- a/docs/src/main/tut/datatypes/state.md +++ b/docs/src/main/tut/datatypes/state.md @@ -141,7 +141,7 @@ The `map` method on `State` allows us to transform the `A` value without affecti ```tut:silent val nextBoolean: State[Seed, Boolean] = nextLong.map(long => - long > 0) + long >= 0) ``` The `flatMap` method on `State[S, A]` lets you use the result of one `State` in a subsequent `State`. The updated state (`S`) after the first call is passed into the second call. These `flatMap` and `map` methods allow us to use `State` in for-comprehensions: @@ -312,4 +312,4 @@ valid.run(Open) ```tut:book valid.run(Closed) -``` \ No newline at end of file +```