Skip to content

Commit ab1ef89

Browse files
roryokanepuredanger
authored andcommitted
Fix indentation and typo in examples/monads.clj
- indentation was incorrect in two places - The variance would indeed be 1/12, which is 0.08333. A ‘0’ was left out. Signed-off-by: puredanger <[email protected]>
1 parent f259e40 commit ab1ef89

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/examples/clojure/examples/monads.clj

+3-3
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
(domonad sequence-m
3838
[x (range 5)
3939
y (range 3)]
40-
(+ x y))
40+
(+ x y))
4141

4242
; Inside a with-monad block, domonad is used without the monad name.
4343
(with-monad sequence-m
@@ -91,7 +91,7 @@
9191
(domonad sequence-m
9292
[x ((m-lift 1 (partial * 2)) (range 5))
9393
y (range 2)]
94-
[x y])
94+
[x y])
9595

9696
; The m-plus operation does concatenation in the sequence monad.
9797
(domonad sequence-m
@@ -183,7 +183,7 @@
183183
(mean (for [x xs] (sq (- x m))))))
184184

185185
; rng implements a uniform distribution in the interval [0., 1.), so
186-
; ideally, the mean would be 1/2 (0.5) and the variance 1/12 (0.8333).
186+
; ideally, the mean would be 1/2 (0.5) and the variance 1/12 (0.08333).
187187
(mean (take 1000 (value-seq rng 1)))
188188
(variance (take 1000 (value-seq rng 1)))
189189

0 commit comments

Comments
 (0)