curry-base-1.1.1: Functions for manipulating Curry programs

Copyright(c) 1999 - 2003 Wolfgang Lux
2011 - 2014 Björn Peemöller (
2017 Finn Teegen (
Safe HaskellSafe





Retrieving curry files

lookupCurryFile :: [FilePath] -> FilePath -> IO (Maybe FilePath) Source #

Search in the given list of paths for the given FilePath and eventually return the file name of the found file.

  • If the file name already contains a directory, then the paths to search in are ignored.
  • If the file name has no extension, then a source file extension is assumed.

lookupCurryModule Source #


:: [FilePath]

list of paths to source files

-> [FilePath]

list of paths to library files

-> ModuleIdent

module identifier

-> IO (Maybe FilePath) 

Search for a given curry module in the given source file and library paths. Note that the current directory is always searched first. Returns the path of the found file.

lookupCurryInterface Source #


:: [FilePath]

list of paths to search in

-> ModuleIdent

module identifier

-> IO (Maybe FilePath)

the file path if found

Search for an interface file in the import search path using the interface extension icurryExt. Note that the current directory is always searched first.

lookupFile Source #


:: [FilePath]

Directories to search in

-> [String]

Accepted file extensions

-> FilePath

Initial file name

-> IO (Maybe FilePath)

FilePath of the file if found

Search in the given directories for the file with the specified file extensions and eventually return the FilePath of the file.

Reading and writing modules from files

getModuleModTime :: FilePath -> IO (Maybe UTCTime) Source #

Get the modification time of a file, if existent

writeModule Source #


:: FilePath

original path

-> String

file content

-> IO () 

Write the content to a file in the given directory.

readModule :: FilePath -> IO (Maybe String) Source #

Read the specified module and returns either 'Just String' if reading was successful or Nothing otherwise.

addVersion :: String -> String -> String Source #

Add the given version string to the file content

checkVersion :: String -> String -> Either String String Source #

Check a source file for the given version string