Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2022
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. data Dirs = Dirs
  2. { baseDir :: FilePath
  3. , binDir :: FilePath
  4. , cacheDir :: FilePath
  5. , logsDir :: FilePath
  6. , confDir :: FilePath
  7. , recycleDir :: FilePath -- mainly used on windows
  8. }
  9. deriving (Show, GHC.Generic)
  10.  
  11. getAllDirs :: IO Dirs
  12. getAllDirs = do
  13. baseDir <- ghcupBaseDir
  14. binDir <- ghcupBinDir
  15. cacheDir <- ghcupCacheDir
  16. logsDir <- ghcupLogsDir
  17. confDir <- ghcupConfigDir
  18. recycleDir <- ghcupRecycleDir
  19. pure Dirs { .. }
  20.  
  21. -- somewhere in main
  22. dirs@Dirs{..} <- getAllDirs
  23.  
  24.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement