title: Creating instance of Read type class in Haskell for custom data type
body: <p>I have a custom data type <code>Foo = Foo{ a :: Int, b :: Int}</code> and I'm trying to make Foo a custom instance of read. I already have a function <code>bar :: String -&gt; Foo</code> and I tried doing this:</p>
  
  <pre><code>instance Read (Foo a b) where
      read s = bar s
  </code></pre>
  
  <p>but I'm getting the following error when I load my file into GHCi to test it: <code>Fraction.hs:11:1: read' is not a (visible) method of class Read'</code></p>
  
  <p>Could someone tell me what the problem is and how I can actually instantiate this type?</p>