title: How do I answer Chapter 18, Exercise 5, Haskell From First Principles not in terms of "flipType" from Exercise 6
body: <p>The exercise is to define the function <code>meh</code>, which I did as follows:</p>
  
  <pre><code>meh :: Monad m =&gt; [a] -&gt; (a -&gt; m b) -&gt; m [b]
  meh input_list transform = concatMonads transformed_input
    where 
      transformed_input = fmap transform input_list
  
  concatMonads :: Monad m =&gt; [m b] -&gt; m [b]
  concatMonads [] = pure []
  concatMonads (first:rest) = (concatMonads rest) &gt;&gt;= (appendListToMonadContent first)
  
  appendListToMonadContent :: Monad m =&gt; m b -&gt; [b] -&gt; m [b]
  appendListToMonadContent cur to_append = fmap (\first -&gt; first:to_append) cur
  </code></pre>
  
  <p>The next exercise is to define <code>flipType :: Monad m =&gt; [m b] -&gt; m [b]</code> and the hint is "reuse <code>meh</code>" (which is easy: <code>flipType l = meh l id</code>). However, my answer to question 5 uses <code>flipType</code>, it is just called <code>concatMonads</code>, so it is obvious that I did it differently than the authors were intending.</p>
  
  <p>How can I define <code>meh</code> without using <code>flipType</code>?</p>