This library is, on the whole, trivial. But on the other hand, it is just complex enough for it to look really ugly when these functions have to be recoded time after time for different projects.
All functions in this library take a string representing the name of the program, and return one or more filepaths representing a directory.
getUserDataDir :: String -> IO FilePathgetUserDataFile :: String -> String -> IO FilePathgetUserConfigDir :: String -> IO FilePathgetUserConfigFile :: String -> String -> IO FilePathgetUserCacheDir :: String -> IO FilePathgetUserCacheFile :: String -> String -> IO FilePathgetSystemDataDirs :: String -> IO [FilePath]getSystemDataFiles :: String -> String -> IO [FilePath]getSystemConfigDirs :: String -> IO [FilePath]getSystemConfigFiles :: String -> String -> IO [FilePath]getAllDataDirs :: String -> IO [FilePath]getAllDataFiles :: String -> String -> IO [FilePath]getAllConfigDirs :: String -> IO [FilePath]getAllConfigFiles :: String -> String -> IO [FilePath]
The 'Dir' and 'Dirs' variants of the functions return a directory or list of directories, whereas the 'File' and 'Files' functions are simply convenience functions which append a filename to the directories.