title: Trouble understanding the type of sequence [Just, Just]
body: <p>I'm confused as to why I got this in GHCi</p>
  
  <pre><code>:t sequence [Just,Just]
  sequence [Just, Just] :: a -&gt; [Maybe a]
  </code></pre>
  
  <p>To elaborate, I can understand <code>sequence [Just 1, Just 2] :: Num a =&gt; Maybe [a]</code> because when looking at the type of sequence</p>
  
  <pre><code>sequence :: (Monad m, Traversable t) =&gt; t (m a) -&gt; m (t a)
  </code></pre>
  
  <p>it is clear that this function takes a collection of monadic values and return a single monadic value of the collection. Thus, when we call <code>sequence [Just 1, Just 2]</code> we should get back a <code>Just</code> of <code>[1,2]</code>. Following that train of thoughts, shouldn't <code>sequence [Just, Just]</code> return a single <code>Just</code>?</p>
  
  <p>Thanks.</p>