mokus0/random-fu — Issue #4: Couldn't match expected type `RVar Char' against inferred type `random-fu-0.1.4:Data.Random.RVar.RVar Char'
Author: mcandre
Created: 2011-12-30 17:16:27+00:00
State: open

Something may have changed in the random-fu API, because my Haskell project, [genetics](https://github.com/mcandre/genetics), fails to compile in Ubuntu.

Specs:

$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 10.04.3 LTS
Release:	10.04
Codename:	lucid

$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 6.12.1

$ cabal --version
cabal-install version 0.8.0
using version 1.8.0.2 of the Cabal library

$ cabal list random-fu --installed
* random-fu
Synopsis: Random number generation
Latest version available: 0.2.1.0
Latest version installed: 0.2.1.0
Homepage: https://github.com/mokus0/random-fu
License: PublicDomain

Trace:

$ git clone https://github.com/mcandre/genetics.git
$ cd genetics
$ make
ghc --make -O2 -fforce-recomp -optl"-Wl,-no_compact_unwind" hellogenetics.hs genetics.hs -package base -package random-extras -package random-fu
[1 of 2] Compiling Genetics ( genetics.hs, genetics.o )
[2 of 2] Compiling Main ( hellogenetics.hs, hellogenetics.o )

hellogenetics.hs:16:22:
Couldn't match expected type `RVar Char'
against inferred type `random-fu-0.1.4:Data.Random.RVar.RVar Char'
In the first argument of `runRVar', namely `(choice ['a' .. 'z'])'
In the expression: runRVar (choice ['a' .. 'z']) DevRandom
In the definition of `randomChar':
randomChar = runRVar (choice ['a' .. 'z']) DevRandom

hellogenetics.hs:25:20:
Couldn't match expected type `RVar a'
against inferred type `random-fu-0.1.4:Data.Random.RVar.RVar Int'
In the first argument of `runRVar', namely
`(choice [0 .. length target - 1])'
In a stmt of a 'do' expression:
index <- runRVar (choice [0 .. length target - 1]) DevRandom
In the expression:
do { index <- runRVar (choice [0 .. length target - 1]) DevRandom;
ch <- randomChar;
return $ take index gene ++ [ch] ++ drop (index + 1) gene }
make: *** [all] Error 1