title: Can not print to file using IO Monad
body: <p>Hello i have done my JSon type and i am trying to it to a file.
  I can do this from the prelude but i can't do it when using the IO Monad.I get the following <code>error</code>:</p>
  
  <pre><code> Main.hs:13:24: error:
      * Couldn't match type `Char' with `[Char]'
        Expected type: String
          Actual type: Char
      * In the second argument of `writeFile', namely `val'
        In a stmt of a 'do' block: writeFile out val
        In the expression:
          do val &lt;- renderJValue sample
             writeFile out val
     |
  13 |          writeFile out val
     |                        ^^^
  </code></pre>
  
  <p><strong>Main</strong></p>
  
  <pre><code> module Main where
          import Jlib
          import Put
          import Data.Typeable
  
          import System.Environment
  
          out="data.txt"
  
          main::IO()
          main=do
               val&lt;-renderJValue sample
               writeFile out val
  </code></pre>
  
  <p>Why would this not work in the IO Monad since <code>renderJValue sample</code> in the prelude works ok .</p>
  
  <p><strong>Jlib.hs</strong></p>
  
  <pre><code>data JValue=JString String
                  |JNumber Double
                  |JBool Bool
                  |JNull
                  |JObject [(String,JValue)]
                  |JArray [JValue]
                  deriving (Eq,Ord,Show)
  </code></pre>
  
  <p><strong>Put.hs</strong></p>
  
  <pre><code>sample=JArray[
                      JObject [("name",JString "adita"),("age",JNumber 13)],
                      JObject [("name",JString "dan"),("kids",JNumber 3)] ,
                      JNumber 3,
                      JBool False,
                      JString "Howdy"
                      ]
  </code></pre>
  
  <p><strong>P.S</strong> <code>renderJValue</code> returns a string</p>
  
  <p><strong>P.S:</strong> if i start the prelude i load the module and i render the value it works:</p>
  
  <pre><code>Prelude System.Environment Put&gt; :load Put
  Ok, two modules loaded.
  Prelude System.Environment Put&gt; renderJValue sample
  "[{name:adita,age:13.0},{name:dan,kids:3.0},3.0,False,Howdy]"
  </code></pre>