这是问题的要点:
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"
}
}
指示如何向其中添加返回语句的奖励积分。
工作代码
这个链接显示了一个有点工作的代码,它允许我使用命令式风格探索问题空间。