title: Haskell methode of class is not visible for instance
body: <p>I'm trying to define a class "Polygon" and subtypes "Triangle" and "Quad". Those should implement the area function of Polygon.</p>
  
  <p>So I tried to make an instance of Polygon, but this doesn't works.</p>
  
  <pre class="lang-hs prettyprint-override"><code>class Polygon a where
  
  area :: a -&gt; Float
  
  data Triangle = MkTriangle {
                          tP1 :: Point,
                          tP2 :: Point,
                          tP3 :: Point}
                          deriving(Show)
  
  data Quad = MkQuad{
                      qP1 :: Point,
                      qP2 :: Point,
                      qP3 :: Point,
                      qP4 :: Point}
                      deriving(Show)
  
  instance Polygon Triangle where
      area triangle = 5.0
  </code></pre>
  
  <p>Note that <code>area triangle = 5.0</code> is just debugging and not the real function.
  Trying to compile this, I am getting the following error:</p>
  
  <pre><code>    `area' is not a (visible) method of class `Polygon'
     |
  57 |         area triangle = 5
     |         ^^^^
  Failed, no modules loaded.
  </code></pre>
  
  <p>Can you give me a hint to fix that? Thank you!</p>