<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 06/10/2012 02:06, brandon s allbery
kf8nh wrote:<br>
</div>
<blockquote
cite="mid:%3C7D5CEB91F7D94BFDAE77AD7CF8568197@gmail.com%3E"
type="cite">
<div><span style="color: rgb(160, 160, 168); ">On Friday, 5
October 2012 at 19:55, <a class="moz-txt-link-abbreviated" href="mailto:thorsopia@lavabit.com">thorsopia@lavabit.com</a> wrote:</span></div>
<blockquote type="cite"
style="border-left-style:solid;border-width:1px;margin-left:0px;padding-left:10px;">
- getArgs :: IO [String]<span>
<div>
<div>
<div><br>
</div>
<div> It can get several params, but its type declaration
looks like it gets</div>
<div> none.</div>
</div>
</div>
</span></blockquote>
<div>It doesn't get any Haskell parameters; it retrieves OS-level
(not Haskell-level) parameters to the program. If you know
Perl, it's the difference between @_ and @ARGV; if Python, the
difference between local parameters and sys.argv. You might
infer from the fact that other languages also distinguish, that
there is an actual difference between function parameters and
program parameters; if you are not clear on this, you will need
to figure it out regardless of the language you're working with.</div>
</blockquote>
Perhaps the confusion comes from the fact that languages such as C
or Java treat the program parameters as function arguments to main.
Position which is not completely non-sensical when calls such as
exec() exist, but I'd rather that they divide the OS-level arguments
from the language-level ones: they are different after all.<br>
<br>
And, judging from its signature, getArgs isn't a function without
parameters but a value representing a list of program parameters,
possibly empty. Said value coming from the system, it is in IO.<br>
<blockquote
cite="mid:%3C7D5CEB91F7D94BFDAE77AD7CF8568197@gmail.com%3E"
type="cite">
<blockquote type="cite"
style="border-left-style:solid;border-width:1px;margin-left:0px;padding-left:10px;">-
dispatch :: [(String, [String] -> IO ())]</blockquote>
<div>Looks to me like it's described fairly well by the text.
What is your confusion?</div>
<div><br>
</div>
<div>It is an association list: a list of pairs, the first
element being a key and the second being a value. The value in
this case is a function which takes a list of strings and
produces an IO action.</div>
<div>
<div>
<div><br>
</div>
<div>-- </div>
<div>
<div>brandon s allbery kf8nh
sine nomine associates</div>
<div><a class="moz-txt-link-abbreviated" href="mailto:allbery.b@gmail.com">allbery.b@gmail.com</a>
<a class="moz-txt-link-abbreviated" href="mailto:ballbery@sinenomine.net">ballbery@sinenomine.net</a></div>
<div>unix/linux, openafs, kerberos, infrastructure
<a class="moz-txt-link-freetext" href="http://sinenomine.net">http://sinenomine.net</a></div>
</div>
<div><br>
</div>
<div>Sent with <a moz-do-not-send="true"
href="http://www.sparrowmailapp.com/?sig">Sparrow</a></div>
</div>
</div>
</blockquote>
</body>
</html>