title: Why are Promises Monads?
body: <p>I've been learning about functional programming and have come across Monads, Functors and Applicatives. </p>
  
  <p>From my understanding the following definitions apply:</p>
  
  <p>a) ( A=>B ) => C[A] => C[B]   | Functor</p>
  
  <p>b) ( A=>C[B] ) => C[A] => C[B]   | Monad</p>
  
  <p>c) ( C[A=>B] ) => C[A] => C[B]  | Applicative</p>
  
  <p>(reference: <a href="https://thedet.wordpress.com/2012/04/28/functors-monads-applicatives-can-be-so-simple/" rel="noreferrer">https://thedet.wordpress.com/2012/04/28/functors-monads-applicatives-can-be-so-simple/</a>) </p>
  
  <p>Furthermore, I understand a Monad is a special case of a Functor. As in, it applies a function <strong>that returns a wrapped value</strong> to a wrapped value and returns a wrapped value. </p>
  
  <p>When we use <code>Promise.then(func)</code>, we are passing the Promise(i.e. C[A]) a function which normally has signature <code>A =&gt; B</code> and return another Promise (i.e. C[B]). So my thinking was that a Promise would only be a Functor and not a Monad as <code>func</code> returns B and not C[B].</p>
  
  <p>However, googling I found out that a Promise is not only a Functor, but also a Monad. I wonder why, as <code>func</code> does not return a wrapped value C[B] but just B. What am I missing?</p>