haskell - Instance error with vector when trying to generate random number -


I am trying to generate random numbers using the System.MWC package. I wrote a small test code below:

  Module where import data Word (Word 32) import control. Monad As the ST import system Random MWC import data. Vector Generic Unboxed as Base Importable Data.Vector.U Test :: Word32 - & gt; Int Test X = Running $ $ Gen General & lt; - Initialize (u frostist [x] :: user word 32) v & lt; I get this example error: error (1,100) General Return v  

The problem is getting an error when I try to use the initialize function: < No frequency for / p>

  (Vector-0.9.1: data. Vector.jeneric.base.Wector U.Worker Word32) which can be used to 'start' potential improvements: (Vector -0.9.1 : Add an example announcement for the data .Vector Generic Base.Vector U.Worker Word 32) Add a 'Do' Block In an STMT: General & lt; - initialize (u.fromlist [x]: U.Vector Word32) in the second argument of `($) ', that is,` do {General & lt; - initialize (u. Florist [x] :: U.Vector Word32); V & LT; - Uniform R (1, 100) genes; Return v} 'in the expression: runST $ do {gen & lt; - initialize (U. From List [x] :: U.Vector Word32); V & LT; - Uniform R (1, 100) genes; Return v} failed, modules loaded: none   

I have confirmed to run info in ghci to confirm that any Example is not defined for Data.Vector.Generic.Base.Vector . I then examined hackage for documents but there is no page for that package

So my question is, where is the missing instance defined? Once I know it has been defined, I can load it Import Data.Vector.Generic.Base.Vector does not work. In addition, there is a dependency on mwc-random-0.13.1.1 package in vector-0.9.1 , as you can see in the error message above.

mwc- random old processed version vector Instead of choosing the latest one if you uninstall the old version of vector and reinstall the mwc-random to pull the updated dependency of vector-0.10 If the problem is solved, then the problem solves itself.

(Note: see the comment series below the question for more details)


Comments