title: How can I apply a function to every argument of another function?
body: <p>I have a function that takes 10 <code>String</code> parameters and during some refactoring, portions of the code have changed so now these parameters end up as <code>Text</code> when the function is called:</p>
  
  <pre><code>fxn :: String -&gt; ... -&gt; IO (Int, String)
  fxn a b c d e f g h i j = do something 
  
  ...
  
  -- Get parameters for fxn
  let a = "blah" :: Text
  ...
  fxn a b c ...
  </code></pre>
  
  <p>Ideally, I could refactor all of the code to use <code>Text</code>, but that is tedious and non ideal currently. I could also easily add a <code>T.unpack</code> to where I get the parameters for my function:</p>
  
  <pre><code>let a = T.unpack ("blah" :: Text)
  </code></pre>
  
  <p>But again, this is non ideal since this happens in several different places for large numbers of arguments and I'd prefer to keep the code cleaner than having dozens of <code>T.unpack</code> statements everywhere. </p>
  
  <p>Is there a way in haskell to either compose the functions so that the arguments are morphed, something like <code>(fxn . T.unpack) a b c ...</code>, or to apply the unpack function to every argument of the f function? This seems like a simple composition problem but I haven't been able to find a solution. </p>