<div dir="ltr">You can save the values inside the EMail module at startup using a global variable, but that is not recommended. (<a href="https://wiki.haskell.org/Top_level_mutable_state">https://wiki.haskell.org/Top_level_mutable_state</a>)</div><div class="gmail_extra"><br><div class="gmail_quote">On 7 June 2015 at 00:15, Sumit Sahrawat, Maths & Computing, IIT (BHU) <span dir="ltr"><<a href="mailto:sumit.sahrawat.apm13@iitbhu.ac.in" target="_blank">sumit.sahrawat.apm13@iitbhu.ac.in</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">It would me more logical if you had three modules, Parser, EMail, Main, where Main imports the other two, and they are independent.</div><div class="gmail_extra"><div><div class="h5"><br><div class="gmail_quote">On 7 June 2015 at 00:13, Mike Houghton <span dir="ltr"><<a href="mailto:mike_k_houghton@yahoo.co.uk" target="_blank">mike_k_houghton@yahoo.co.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
I’ve haskell files parser.hs and email.hs<br>
email.hs is a module imported into parser and parser has the main.<br>
<br>
email has various passwords and server names needed to connect and send email. I want to have those details in a config file and read it in at start - using say config module. I’m ok with this part but the practicality of doing it eludes me...<br>
<br>
It seems to me that email module can either get the config details itself or be told them by parser. If email wants to get them how would it do this? It does not have a main that gets run so can’t load a config file.(can it ??)<br>
<br>
However parser can load the config in its main and then tell mail what the values are but how would mail save them?<br>
<br>
Of course I could chanage the signatures of the email send/receive functions in mail to take the connection details but that seems wrong.<br>
<br>
Thanks<br>
<br>
Mike<br>
<br>
<br>
_______________________________________________<br>
Beginners mailing list<br>
<a href="mailto:Beginners@haskell.org" target="_blank">Beginners@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners</a><br>
</blockquote></div><br><br clear="all"><div><br></div></div></div><span class="HOEnZb"><font color="#888888">-- <br><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div>Regards</div><div dir="ltr"><div><br></div><div>Sumit Sahrawat</div></div></div></div></div></div></div>
</font></span></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div>Regards</div><div dir="ltr"><div><br></div><div>Sumit Sahrawat</div></div></div></div></div></div></div>
</div>