[Haskell-beginners] How to pass configuration to a function further down the call stack?

Thomas Koch thomas at koch.ro
Tue Sep 30 20:15:57 UTC 2014


Hi,

I wrote my first Haskell 'project', a test suite for my personal SIEVE mail 
filter script using dovecots 'sieve-test' tool:

https://github.com/thkoch2001/sieve-test-hs

The file Network/Sieve/Test.hs might actually be interesting as a standalone 
library. The most important function is

assertMailActions :: Mail -> Actions -> IO ()

'Actions' is a type that describes the result of running a SIEVE filter over 
the passed mail, e.g. store in a certain folder, discard, reject, ...

Somewhere the external process 'sieve-test' is called. At this point I'd like 
to make certain things configurable:

- the path and name of the executable
- the parameters for the test-sieve executable
- the name of the sieve script
- the place where to store the temporary mail files
- whether or not to remove the temporary mail files

Does anybody has an idea where I could start to look for a solution?

Thank you,

Thomas Koch


More information about the Beginners mailing list