title: How do I write, "if typeclass a, then a is also an instance of b by this definition."
body: <p>I have a typeclass <code>MyClass</code>, and there is a function in it which produces a <code>String</code>.  I want to use this to imply an instance of <code>Show</code>, so that I can pass types implementing <code>MyClass</code> to <code>show</code>.  So far I have,</p>
  
  <pre><code>class MyClass a where
      someFunc :: a -&gt; a
      myShow :: a -&gt; String 
  
  instance MyClass a =&gt; Show a where
      show a = myShow a
  </code></pre>
  
  <p>which gives the error <code>Constraint is no smaller than the instance head.</code>  I also tried,</p>
  
  <pre><code>class MyClass a where
      someFunc :: a -&gt; a
      myShow :: a -&gt; String
  
  instance Show (MyClass a) where
      show a = myShow a
  </code></pre>
  
  <p>which gives the error, <code>Class</code>MyClass' used as a type`.</p>
  
  <p>How can I correctly express this relationship in Haskell?
  Thanks.</p>
  
  <p>I should add that I wish to follow this up with specific instances of <code>MyClass</code> that emit specific strings based on their type.  For example,</p>
  
  <pre><code>data Foo = Foo
  data Bar = Bar
  
  instance MyClass Foo where
      myShow a = "foo"
  
  instance MyClass Bar where
      myShow a = "bar"
  
  main = do
      print Foo
      print Bar
  </code></pre>