[Haskell-beginners] Config data

Sumit Sahrawat, Maths & Computing, IIT (BHU) sumit.sahrawat.apm13 at iitbhu.ac.in
Sat Jun 6 18:49:52 UTC 2015


You can save the values inside the EMail module at startup using a global
variable, but that is not recommended. (
https://wiki.haskell.org/Top_level_mutable_state)

On 7 June 2015 at 00:15, Sumit Sahrawat, Maths & Computing, IIT (BHU) <
sumit.sahrawat.apm13 at iitbhu.ac.in> wrote:

> It would me more logical if you had three modules, Parser, EMail, Main,
> where Main imports the other two, and they are independent.
>
> On 7 June 2015 at 00:13, Mike Houghton <mike_k_houghton at yahoo.co.uk>
> wrote:
>
>> Hi,
>>
>> I’ve haskell files  parser.hs and email.hs
>> email.hs is a module imported into parser and parser has the main.
>>
>> 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...
>>
>> 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
>> ??)
>>
>> However parser can load the config in its main and then tell mail what
>> the values are but how would mail save them?
>>
>> Of course I could chanage the signatures of the email send/receive
>> functions in mail  to take the connection details but that seems wrong.
>>
>> Thanks
>>
>> Mike
>>
>>
>> _______________________________________________
>> Beginners mailing list
>> Beginners at haskell.org
>> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>>
>
>
>
> --
> Regards
>
> Sumit Sahrawat
>



-- 
Regards

Sumit Sahrawat
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/beginners/attachments/20150607/9ea85823/attachment.html>


More information about the Beginners mailing list