title: What does instance mean in Haskell?
body: <p>In object-oriented languages (e.g; Java and Python) we can make objects/instances from classes.
  In Haskell we can make instances from type-classes, ex:</p>
  <pre><code>data ShirtSize = S | M | L      -- Here ShirtSize is a enum data-type
  
  class MyEq a where
    (==) :: a -&gt; a -&gt; Bool
  instance MyEq ShirtSize where   -- Here ShirtSize is an instance of the MyEq type-class
    S == S = True
    M == M = True
    L == L = True
    _ == _ = False
  </code></pre>
  <p><strong>My question is:</strong>
  What does instance mean in haskell?
  In java we can make instances from classes, but in haskell it seems like instances are types (like ShirtSize) which you can apply type-class functions on (e.g the <strong>(==)</strong> function from MyEq). Am I right? and also what is an instance in Haskell compared to an instance/object in Java?</p>