import System.Random.MWC
import Data.Vector.Unboxed
main :: IO ( )
main = do
numbers <- withSystemRandom . asGenIO $ \gen -> uniformVector gen 20
print ( numbers :: Vector Int )
putStrLn "All done"
Error is following.
No instance for (vector-0.11.0.0:Data.Vector.Generic.Base.Vector
Vector Int)
arising from a use of ‘uniformVector’
In the expression: uniformVector gen 20
In the second argument of ‘($)’, namely
‘\ gen -> uniformVector gen 20’
In a stmt of a 'do' block:
numbers <- withSystemRandom . asGenIO
$ \ gen -> uniformVector gen 20
Following snippets fails.
Error is following.
GHCi, version 7.10.3.