module Curry.Files.Filenames where
import System.FilePath
curryExt, lcurryExt, icurryExt, oExt :: String
curryExt = ".curry"
lcurryExt = ".lcurry"
icurryExt = ".icurry"
flatExt = ".fcy"
extFlatExt = ".efc"
flatIntExt = ".fint"
xmlExt = "_flat.xml"
acyExt = ".acy"
uacyExt = ".uacy"
sourceRepExt = ".cy"
oExt = ".o"
debugExt = ".d.o"
sourceExts, moduleExts, objectExts :: [String]
sourceExts = [curryExt,lcurryExt]
moduleExts = sourceExts ++ [icurryExt]
objectExts = [oExt]
interfName :: FilePath -> FilePath
interfName sfn = replaceExtension sfn icurryExt
flatName :: FilePath -> FilePath
flatName fn = replaceExtension fn flatExt
extFlatName :: FilePath -> FilePath
extFlatName fn = replaceExtension fn extFlatExt
flatIntName :: FilePath -> FilePath
flatIntName fn = replaceExtension fn flatIntExt
xmlName :: FilePath -> FilePath
xmlName fn = replaceExtension fn xmlExt
acyName :: FilePath -> FilePath
acyName fn = replaceExtension fn acyExt
uacyName :: FilePath -> FilePath
uacyName fn = replaceExtension fn uacyExt
sourceRepName :: FilePath -> FilePath
sourceRepName fn = replaceExtension fn sourceRepExt
objectName :: Bool -> FilePath -> FilePath
objectName debug = name (if debug then debugExt else oExt)
where name ext fn = replaceExtension fn ext