milad zahedi
milad zahedi

Reputation: 807

haskell global variable for project config

I have a project and I read the config from a file. I want these configurations to be available every where.

What is the best way to do this in Haskell?

Someone said I could write to System.Environment. Is this OK?

Upvotes: 0

Views: 113

Answers (1)

mschmidt
mschmidt

Reputation: 2790

For a complex configuration I would recommend to have a look at the reader Monad. An example can be found here: Three Useful Monads

Upvotes: 1

Related Questions