fork download
  1. -- from stackoverflow.com/questions/52031091/
  2. -- haskell-how-do-i-nest-multiple-if-statements-
  3.  
  4. check_if_proceed configFolders = do
  5. let emacsdf = "/home/jacek/.emacs.d"
  6. traceM ("calling check_if_proceed " ++ show ("ccc",configFolders))
  7. exists <- doesDirectoryExist emacsdf
  8. symlink <- pathIsSymbolicLink emacsdf
  9. let confemp = configFolders == []
  10. let result = False
  11. if exists
  12. then do
  13. {
  14. if symlink
  15. then do
  16. {
  17. putStrLn ("This action will overwrite the existing symlink\n"++
  18. "poinitng to " ++ "SOMEWHERE-FINISH ME\n\n" )
  19. }
  20. else do
  21. {
  22. putStrLn (emacsdf ++ " is not a symlink\n"++
  23. "to use this utility, in your terminal do soemthing like:\n"++
  24. "$ mv " ++ emacsdf ++ " " ++ emacsdf ++ "-alternative-config\n" ++
  25. "exiting..." )
  26. }
  27. }
  28. else do
  29. {
  30. putStrLn ("no " ++ emacsdf ++ "found in your home folder")
  31. ; if confemp
  32. then do
  33. {
  34. putStrLn ("nor folders with the alternative emacs config\n" ++
  35. "exiting..." )
  36.  
  37. }
  38. else
  39. do {
  40. putStrLn "will try to symlink one of the found folders"
  41. }
  42. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
[1 of 1] Compiling Main             ( prog.hs, prog.o )

prog.hs:1:1: error:
    The IO action ‘main’ is not defined in module ‘Main’
stdout
Standard output is empty