title: How to create a random boolean generator in Haskell?
body: <p>I'm new to Haskell and I am trying to write a random boolean generator. I was able to make a function that generates the random boolean and saves it into a list. I want to define a function that extracts the value of the list.</p>
  
  <p>This is what I have done so far  </p>
  
  <pre><code>import System.Random
  import Control.Monad
  
  makeBool:: Int -&gt; IO [Bool]
  makeBool n = replicateM n randomIO
  
  extractBool:: IO [Bool] -&gt; Bool 
  extractBool x = x !! 0
  </code></pre>
  
  <p>However, I am getting this error, Please Help!!</p>
  
  <pre><code>* Couldn't match expected type `[Bool]'
                with actual type `IO [Bool]'
  * In the first argument of `(!!)', namely `x'
    In the expression: x !! 0
    In an equation for `extractBool': extractBool x = x !! 0
  Failed, modules loaded: none.
  </code></pre>