title: Haskell, No instance for (Applicative M)
body: <p>Look at my code. ghci told that </p>
  
  <p>No instance for (Applicative M)
    arising from the superclasses of an instance declaration
  In the instance declaration for ‘Monad M’</p>
  
  <p>I don't understand this error, and I don't know how to fix it. Could you help me ?</p>
  
  <pre><code>newtype M a = StOut (Stack -&gt; (a, Stack, String))
  
  unStOut (StOut f) = f
  --unStout is used to extract the emeded function from monadic capsule
  
  instance Monad M where
      return x = StOut (\n -&gt; (x, n, ""))
      e &gt;&gt;= f = StOut (\n -&gt;  let     (a, n1, s1) = (unStOut e) n
                                      (b, n2, s2) = (unStOut (f a)) n1
                              in      (b, n2, s1++s2))
  </code></pre>