createState :: Args.Options -> Maybe Settings -> Maybe Identity -> IO (Maybe State)
createState o Nothing _ = do
  c <- getCfgFile (Args.optCfgFile o)
  st <- loadCfg c
  case st of
    Nothing -> return Nothing
    Just s -> createState o (Just s) Nothing
createState :: Args.Options -> Maybe Settings -> Maybe Identity -> IO (Maybe State)
createState o Nothing _ = do
  c <- getCfgFile (Args.optCfgFile o)
  st <- loadCfg c
  case st of
    Nothing -> return Nothing
    Just s -> createState o (Just s) Nothing
createState o Nothing _ = do
  c <- getCfgFile (Args.optCfgFile o)
  st <- loadCfg c
  case st of
    Nothing -> return Nothing
    Just s -> createState o (Just s) Nothing