title: Parsing JSON string into record in Haskell
body: <p>I'm struggling to understand this (I'm still a bit new to Haskell) but I'm finding the documentation for the <code>Text.JSON</code> package to be a little confusing. Basically I have this data record type: -</p>
  
  <pre><code>data Tweet = Tweet
      {
          from_user :: String,
          to_user_id :: String,
          profile_image_url :: String,
          created_at :: String,
          id_str :: String,
          source :: String,
          to_user_id_str :: String,
          from_user_id_str :: String,
          from_user_id :: String,
          text :: String,
          metadata :: String
      }
  </code></pre>
  
  <p>and I have some tweets in JSON format that conform to the structure of this type. The thing that I'm struggling with is how to map the above to what gets returned from the following code</p>
  
  <pre><code>decode tweet :: Result JSValue
  </code></pre>
  
  <p>into the above datatype. I understand that I'm supposed to create an instance of <code>instance JSON Tweet</code> but I don't know where to go from there.</p>
  
  <p>Any pointers would be greatly appreciated, thanks!</p>