moduleConfig.Dyre.PathswhereimportSystem.InfoimportSystem.TimeimportSystem.FilePathimportSystem.DirectoryimportSystem.Environment.ExecutableimportSystem.Environment.XDG.BaseDirimportConfig.Dyre.ParamsimportConfig.Dyre.Options-- | Return the paths to, respectively, the current binary, the custom-- binary, the config file, and the cache directory.getPaths::Paramsc->IO(FilePath,FilePath,FilePath,FilePath,FilePath)getPathsparams@Params{projectName=pName}=dothisBinary<-getExecutablePathdebugMode<-getDebugcwd<-getCurrentDirectorycacheDir<-case(debugMode,cacheDirparams)of(True,_)->return$cwd</>"cache"(False,Nothing)->getUserCacheDirpName(False,Justcd)->cdconfigDir<-case(debugMode,configDirparams)of(True,_)->returncwd(False,Nothing)->getUserConfigDirpName(False,Justcd)->cdlettempBinary=cacheDir</>pName++"-"++os++"-"++arch<.>takeExtensionthisBinaryletconfigFile=configDir</>pName++".hs"letlibsDir=configDir</>"lib"return(thisBinary,tempBinary,configFile,cacheDir,libsDir)-- | Check if a file exists. If it exists, return Just the modification-- time. If it doesn't exist, return Nothing.maybeModTime::FilePath->IO(MaybeClockTime)maybeModTimepath=dofileExists<-doesFileExistpathiffileExiststhenfmapJust$getModificationTimepathelsereturnNothing