小集團安裝隨機額外轉換Data.RVar.RVar [字符]至[字符]
Prelude Data.Random.Extras> import Data.Random.Extras
Prelude Data.Random.Extras> let s = shuffle "somestring"
Prelude Data.Random.Extras> s
<interactive>:1:1:
No instance for (Show (Data.RVar.RVar [Char]))
arising from a use of `print'
Possible fix:
add an instance declaration for (Show (Data.RVar.RVar [Char]))
In a stmt of an interactive GHCi command: print it
我如何轉換Data.RVar.RVar [字符]至[字符]?
更新時間:
我無法導入Data.Random.Source.DevRandom:
Prelude> import Data.Random hiding (shuffle)
Prelude Data.Random> import Data.Random.Source.DevRandom
<no location info>:
Could not find module `Data.Random.Source.DevRandom':
Use -v to see a list of the files searched for.
但是:
[59]: cabal install random-fu
Resolving dependencies...
No packages to be installed. All the requested packages are already installed.
If you want to reinstall anyway then use the --reinstall flag.
[60]: cabal install random-source
Resolving dependencies...
No packages to be installed. All the requested packages are already installed.
If you want to reinstall anyway then use the --reinstall flag.
更新2:
*Main System.Random> import Data.Random hiding (shuffle)
*Main System.Random Data.Random> import Data.Random.Source.Std
*Main System.Random Data.Random Data.Random.Source.Std> import Data.Random.Extras
*Main System.Random Data.Random Data.Random.Source.Std Data.Random.Extras> let reversed = runRVar (shuffle "somestring") StdRandom
<interactive>:1:16:
Ambiguous type variable `m0' in the constraints:
(MonadRandom m0) arising from a use of `runRVar'
at <interactive>:1:16-22
(Monad m0) arising from a use of `runRVar' at <interactive>:1:16-22
Probable fix: add a type signature that fixes these type variable(s)
In the expression: runRVar (shuffle "somestring") StdRandom
In an equation for `reversed':
reversed = runRVar (shuffle "somestring") StdRandom
'Data.Random.Source.DevRandom'也包含在'隨機extra'包('[11 9]編譯Data.Random.Source.DevRandom(src/Data/Random/Source/DevRandom.hs,dist/build/Data/Random/Source/DevRandom.o)')。 – leftaroundabout
也許是隨機附加的?我也是這樣安裝的。 – demas
這裏是重新安裝的日誌http://pastebin.com/pkxzZC9r – demas