title: Function variable not in scope Haskell
body: <p>Hi i have the following code</p>
  
  <pre><code>import Data.Maybe
  import Test.QuickCheck
  import System.Random
  
  
  rndExpr :: Gen Expr -&gt;  IO Expr
  rndExpr gen = do
      rnd &lt;-  newStdGen
      return (generate 5 rnd gen)
  </code></pre>
  
  <p>But i get "not in scope "generate", why is this so?</p>
  
  <p>Regards
  Darren</p>
  
  <p>Edit i am importing Test.QuickCheck but it still complaints about the "generate" is not in scope.</p>
  
  <p>Edit 2</p>
  
  <p>How would you write this function so that it would work with quickcheck version 2? I simple tried to put "unGen" where generate was with no succsess, i also installed quickcheck v 2 (cabal install QuickCheck-2.1.0.3)</p>
  
  <p>I need a function with following properties <code>stdGen-&gt;Gen Expr-&gt;Expr'</code>
  and unGen seem to give me that functionality, but as I said, my compiler cant find that function. Are there any other functions that I could use for this problem?</p>