-3

これが問題の要点です:

check_if_proceed configFolders = do
  let emacsdf = "/home/jacek/.emacs.d"
  traceM ("calling check_if_proceed " ++ show ("ccc",configFolders))
  exists <- doesDirectoryExist emacsdf
  symlink <- pathIsSymbolicLink emacsdf
  let confemp = configFolders == []
  let result = False
  if exists
    then do
    {
      if symlink
      then do
        {
          putStrLn ("This action will overwrite the existing symlink\n"++
                    "poinitng to " ++ "SOMEWHERE-FINISH ME\n\n" )
        }
      else do
        {
          putStrLn (emacsdf ++ " is not a symlink\n"++
                    "to use this utility, in your terminal do soemthing like:\n"++
                    "$ mv " ++ emacsdf ++ " " ++ emacsdf ++ "-alternative-config\n" ++
                    "exiting..." )
        }
    }
    else do
    {
      putStrLn ("no " ++ emacsdf ++ "found in your home folder")
      if confemp
      then do
        {
          putStrLn ("nor folders with the alternative emacs config\n" ++
                    "exiting..." )

        }
      else
        do {
          putStrLn "will try to symlink one of the found folders"
          }
    }

returnステートメントをそれに追加する方法を示すためのボーナスポイント。

作業コード

このリンクは、命令型スタイルを使用して問題空間を探索できる、ある程度機能するコードを示しています。

4

1 に答える 1