module Data.Random.Vector(randomElement) where
import Data.Random.RVar
import Data.Random.Distribution.Uniform
import qualified Data.Vector as V
randomElement :: V.Vector a -> RVar a
randomElement :: forall a. Vector a -> RVar a
randomElement Vector a
wrds = (Vector a
wrds forall a. Vector a -> Int -> a
V.!) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall a. Distribution Uniform a => a -> a -> RVar a
uniform Int
0 (forall a. Vector a -> Int
V.length Vector a
wrds forall a. Num a => a -> a -> a
- Int
1)