curry-base-1.1.1: Functions for manipulating Curry programs

Copyright(c) 1999 - 2003 Wolfgang Lux
2011 - 2014 Björn Peemöller (bjp@informatik.uni-kiel.de)
2017 Finn Teegen (fte@informatik.uni-kiel.de)
LicenseBSD-3-clause
Maintainerbjp@informatik.uni-kiel.de
Stabilityexperimental
Portabilityportable
Safe HaskellSafe
LanguageHaskell2010

Curry.Files.PathUtils

Contents

Description

 
Synopsis

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 #

Arguments

:: [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 #

Arguments

:: [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 #

Arguments

:: [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 #

Arguments

:: 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