RosettaCodeData/Task/Read-a-configuration-file/Haskell/read-a-configuration-file-2.hs
Ingy döt Net b83f433714 tasks a-s
2013-04-10 23:57:08 -07:00

8 lines
258 B
Haskell

import Data.ConfigFile
import Data.Either.Utils
getSetting cp x = forceEither $ get cp "Default" x
cp <- return . forceEither =<< readfile emptyCP "name_of_configuration_file"
let username = getSetting cp "username"
password = getSetting cp "password"