title: Why are getArgs and getProgName IO actions?
body: <p>I'm a complete newbie currently trying to learn Haskell with "<a href="http://learnyouahaskell.com/" rel="nofollow noreferrer">Learn You a Haskell for Great Good</a>". I've reach <a href="http://learnyouahaskell.com/input-and-output#command-line-arguments" rel="nofollow noreferrer">the section explaining how to work with command line arguments</a>, and something is bugging me.</p>
  
  <p>From my understanding (and <a href="http://www.haskell.org/haskellwiki/Introduction_to_Haskell_IO/Actions" rel="nofollow noreferrer">haskell.org's definition</a>), actions are meant to encapsulate side effects. Command line arguments being immutable inputs for a given instance of the program, then what is the point of having <code>getProgName :: IO String</code> rather than <code>getProgName :: String</code>? Differently put: what's the point of preventing a pure function from calling <code>getProgName</code>?</p>
  
  <p><strong>Update</strong></p>
  
  <p>I had some great answers to this question so far. I'm accepting <a href="https://stackoverflow.com/a/14296155/451980">Don Stewart's</a> as the most simple and concise, but <a href="https://stackoverflow.com/a/14296888/451980">Conal's</a> (with its associated <a href="http://conal.net/blog/posts/is-haskell-a-purely-functional-language/" rel="nofollow noreferrer">blog post</a>) is definitely worth a read.</p>