KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
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 getProgName ? Update I had some great answers to this question so far. I'm accepting Don Stewart's as the most simple and concise, but Conal's (with its associated blog post ) is definitely worth a read.
Tags (comma-separated)
Save Edits
Cancel