Why are getArgs and getProgName IO actions?
|January 12, 2013||Posted by forumadmin under TechQns||
I’m a complete newbie currently trying to learn Haskell with “Learn You a Haskell for Great Good“. I’ve reach the section explaining how to work with command line arguments, and something is bugging me.
From my understanding (and haskell.org’s definition), 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
getProgName :: IO String rather than
getProgName :: String? Differently put: what’s the point of preventing a pure function from calling
|Asked By – icecrime||Read Answers|