title: How to construct a no-op IO() expression in Haskell?
body: <p>Here's an excerpt of a domain-specific file-IO function I'm writing:</p>
  
  <pre><code>let
      cp :: FilePath -&gt; IO ()
      cp "." = putStr "" -- OUCH!
      cp ".." = putStr "" -- CRIKEY!
      cp fname = custom logic here...
  in mapM_ cp filepaths
  </code></pre>
  
  <p>I understand <code>mapM_</code> lets us drop/ignore all <code>IO ()</code> results, so I'd like a cleaner alternative to <code>putStr ""</code> --- ie. Haskell's "canonical" way to write "a type-correct no-op IO (or monad) expression that does nothing".</p>
  
  <p>From my newbie reading I had <code>undefined</code> in mind, and while this compiles and causes no issues, it gives an unwanted stdout print <code>main.hs: Prelude.undefined</code> (I use <code>stack runghc main.hs</code> as the <em>sole</em> coding environment here --- it's just sufficient for this, <em>but</em> the above code will be looping recursively through directory trees: so would be a good time to (re)learn about a better, or rather "the proper" way).</p>