title: bind can be composed of fmap and join, so do we have to use monadic functions a -> m b?
body: <p>I don't use Haskell a lot, but I understand the concept of Monads.</p>
  
  <p>I had been confused by <a href="https://en.wikipedia.org/wiki/Kleisli_category#Extension_operators_and_Kleisli_triples" rel="noreferrer">Kleisli triple</a>, and the category, however, </p>
  
  <p><a href="https://en.wikipedia.org/wiki/Monad_(functional_programming)#fmap_and_join" rel="noreferrer">fmap and join</a></p>
  
  <blockquote>
    <p>Although Haskell defines monads in terms of the return and bind functions, it is also possible to define a monad in terms of <code>return</code> and two other operations, <code>join</code> and <code>fmap</code>. This formulation fits more closely with the original definition of monads in category theory. The <code>fmap</code> operation, with type <code>(t → u) → M t → M u</code>, takes a function between two types and produces a function that does the "same thing" to values in the monad. The <code>join</code> operation, with type <code>M (M t) → M t</code>, "flattens" two layers of monadic information into one.</p>
  </blockquote>
  
  <p>helps me to the background principle of Monads.</p>
  
  <blockquote>
    <p>The two formulations are related as follows:</p>
  </blockquote>
  
  <pre><code>fmap f m = m &gt;&gt;= (return . f)
  join n   = n &gt;&gt;= id
  
  fmap :: (a -&gt; b) -&gt; (m a -&gt; m b)
  unit :: a -&gt; m a
  join :: m (m a) -&gt; m a
  &gt;&gt;=  :: m a -&gt; (a -&gt; m b) -&gt; m b
  
  m &gt;&gt;= f  =  join $ fmap f m
  </code></pre>
  
  <p>My question is:
  I think that since <code>&gt;&gt;=</code>  can be composed of <code>fmap</code> and <code>join</code>, a monadic function 
  <code>a -&gt; m b</code> is not required and normal functions <code>a -&gt; b</code> will satisfy the operation, but so many tutorials around the web still insist to use a monadic functions since that is the Kleisli triple and the monad-laws.</p>
  
  <p>Well, shouldn't we just use non-monadic functions, as long as they are endo-functions, for the simplicity? What do I miss?</p>
  
  <p>Related topics are</p>
  
  <p><a href="https://stackoverflow.com/questions/3382210/monad-join-function">Monad join function</a></p>
  
  <p><a href="https://stackoverflow.com/questions/7975022/haskell-monad-bind-operator-confusion">Haskell Monad bind operator confusion</a></p>
  
  <p><a href="https://stackoverflow.com/questions/35387237/difference-in-capability-between-fmap-and-bind">Difference in capability between fmap and bind?</a></p>