title: How does return statement work in Haskell?
body: <p>Consider these functions</p>
  
  <pre><code>f1 :: Maybe Int
  f1 = return 1
  
  f2 :: [Int]
  f2 = return 1
  </code></pre>
  
  <p>Both have the same statement <code>return 1</code>. But the results are different. <code>f1</code> gives value <code>Just 1</code> and <code>f2</code> gives value <code>[1]</code></p>
  
  <p>Looks like Haskell invokes two different versions of <code>return</code> based on return type. I like to know more about this kind of function invocation. Is there a name for this feature in programming languages? </p>