MSeq and MRand documentation: give an example.
Suggested-by: Dai Weituo
This commit is contained in:
parent
44d184b6d4
commit
1f2bf2bb13
@ -1 +1,13 @@
|
|||||||
include Utils.MonadPlus
|
include Utils.MonadPlus
|
||||||
|
|
||||||
|
(**
|
||||||
|
We demand that [MRand.run e] returns an infinite sequence of solutions
|
||||||
|
sampled from [e], for example
|
||||||
|
{[
|
||||||
|
(let open MRand in sum [return 1; return 2; return 3])
|
||||||
|
|> MRand.run (* infinite stream of random samples *)
|
||||||
|
|> Seq.take 10 (* take the first 10 elements *)
|
||||||
|
|> List.of_seq
|
||||||
|
]}
|
||||||
|
could be the list [[1; 2; 1; 2; 1; 1; 1; 3; 3; 2]].
|
||||||
|
*)
|
||||||
|
|||||||
12
src/MSeq.mli
12
src/MSeq.mli
@ -1 +1,13 @@
|
|||||||
include Utils.MonadPlus
|
include Utils.MonadPlus
|
||||||
|
|
||||||
|
(**
|
||||||
|
We demand that [MSeq.run e] returns the finite list of solutions
|
||||||
|
for [e], for example
|
||||||
|
{[
|
||||||
|
(let open MSeq in sum [return 1; return 2; return 3])
|
||||||
|
|> MSeq.run (* list of all solutions *)
|
||||||
|
|> List.of_seq
|
||||||
|
]}
|
||||||
|
should be the list [[1; 2; 3]] -- or maybe the same elements in
|
||||||
|
some other order.
|
||||||
|
*)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user