Dear Haskellers,
I've been working on variants of the following code:
connect_from_file :: String -> IO Connection
connect_from_file fi = do
s <- BL.readFile fi
cred <- (decode s :: Maybe Db_cred)
c <- connect . reformat_cred $ cred
return c
What
this code intends to do is read a config from a file in JSON,
decode the JSON, and then open a
connection based the decoded info. This code doesn't compile for several
reasons, but I've left it in this form because I believe it is the most
convenient for approaching my question: