title: Scala type parameters in various places
body: <p>I have just started learning scala and have some issues with general understanding of type parameters. Previously I learned Haskell, but in scala it seems very confusing to me. It is unclear for me where should I put type parameters (near class definition or function definition).</p>
  
  <p>Consider the example:</p>
  
  <pre><code>class Person[A] {
    def sayName (name: A) = println(name)
  }
  </code></pre>
  
  <p>Does it make sense to move type parameter from class to function?</p>
  
  <pre><code>class Person {
    def sayName[A] (name: A) = println(name)
  }
  </code></pre>
  
  <p>Or I even can leave type parameter both in class and function and it will work. Does it make some big difference? 
  Will the [A] parameters in function override same param from class definition?</p>
  
  <p>And I can create the instance of Person or call a function without pointing the exact type.</p>
  
  <pre><code>val p = new Person();
  </code></pre>
  
  <p>So why is this for? Just in cases when I want smth generic? 
  So it is unclear for me when and on which positions (class or function) should I put type parameters.</p>