
Vanessa McHale
Hi Magnus,
I would use getEnv http://hackage.haskell.org/package/base-4.11.1.0/docs/System-Environment.htm... or lookupEnv, along with Template Haskell and the runIO http://hackage.haskell.org/package/template-haskell-2.13.0.0/docs/Language-H... function. This would allow you to embed environment variables at compile time.
Thanks! That were indeed the functions I was looking for. I ended up with the following: ```haskell import Data.Maybe (fromMaybe) import Language.Haskell.TH (ExpQ, runIO, stringE) import System.Environment (lookupEnv) getBuildEnv :: String -> String -> ExpQ getBuildEnv def varname = (runIO $ fromMaybe def <$> lookupEnv varname) >>= stringE ``` /M -- Magnus Therning OpenPGP: 0x927912051716CE39 email: magnus@therning.org jabber: magnus@therning.org twitter: magthe http://therning.org/magnus Ah, good taste! What a dreadful thing! Taste is the enemy of creativeness. — Pablo Picasso