mainArgs :: IO (ClaferArgs, String)
mainArgs = do
  args' <- cmdArgs clafer 
  model <- case file args' of
             "" -> hGetContents stdin
             f  -> readFile f
  let args'' = argsWithOPTIONS args' model
  -- Alloy should be the default mode but only if nothing else was specified
  -- cannot use [ Alloy ] as the default in the definition of `clafer :: ClaferArgs` since 
  -- Alloy will always be a mode in addition to the other specified modes (it will become mandatory)
  let args''' = if null $ mode args''
                then args''{mode = [ Alloy ]}
                else args''
  return $ (args''', model)
mainArgs :: IO (ClaferArgs, String)
mainArgs = do
  args' <- cmdArgs clafer 
  model <- case file args' of
             "" -> hGetContents stdin
             f  -> readFile f
  let args'' = argsWithOPTIONS args' model
  -- Alloy should be the default mode but only if nothing else was specified
  -- cannot use [ Alloy ] as the default in the definition of `clafer :: ClaferArgs` since 
  -- Alloy will always be a mode in addition to the other specified modes (it will become mandatory)
  let args''' = if null $ mode args''
                then args''{mode = [ Alloy ]}
                else args''
  return $ (args''', model)
mainArgs = do
  args' <- cmdArgs clafer 
  model <- case file args' of
             "" -> hGetContents stdin
             f  -> readFile f
  let args'' = argsWithOPTIONS args' model
  -- Alloy should be the default mode but only if nothing else was specified
  -- cannot use [ Alloy ] as the default in the definition of `clafer :: ClaferArgs` since 
  -- Alloy will always be a mode in addition to the other specified modes (it will become mandatory)
  let args''' = if null $ mode args''
                then args''{mode = [ Alloy ]}
                else args''
  return $ (args''', model)