sampling

Basic sampling functionality for Haskell.
Log | Files | Refs | README | LICENSE

commit 289655caaaf6ee68f4f19bead0163a0decfd80df
parent de53372591ea9eb7afd61383b4b0264b818cd6fc
Author: Jared Tobin <jared@jtobin.ca>
Date:   Tue,  9 Feb 2016 22:11:11 +1300

Update README example. [ci skip]

Diffstat:
MREADME.md | 12++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/README.md b/README.md @@ -30,16 +30,16 @@ The non-`IO` specialized functions can be used with any `PrimMonad`. ## Examples -Sample ten elements from a list, with replacement: +Sample five elements from a list, without replacement: - > resampleIO 10 ['a'..'g'] - "ddgaefbgef" + > sampleIO 10 ['a'..'z'] + Just "azctumlhwj" -Sample five elements from a Map, without replacement: +Sample five elements from a Map, with replacement: > import qualified Data.Map.Strict as Map - > sampleIO 5 (Map.fromList (zip [1..1000] (scanl1 (/) [1..]))) - Just [0.0,1.0126536951759521e-203,2.9893108271424046e-50,0.0,0.0] + > sampleIO 5 (Map.fromList [(1, "apple"), (2, "orange"), (3, "pear")]) + ["apple", "apple", "pear", "orange", "pear"] ## Development