CurryInfo: currypath-3.0.0 / System.CurryPath.lookupModuleSource

definition: Info
 
lookupModuleSource :: [String] -> String -> IO (Maybe (String,String))
lookupModuleSource loadpath mods =
  if isValidModuleName mod
    then lookupSourceInPath loadpath
    else return Nothing
 where
  mod      = stripCurrySuffix mods
  fnlcurry = modNameToPath mod ++ ".lcurry"
  fncurry  = modNameToPath mod ++ ".curry"

  lookupSourceInPath [] = return Nothing
  lookupSourceInPath (dir:dirs) = do
    lcurryExists <- doesFileExist (dir </> fnlcurry)
    if lcurryExists
      then return (Just (dir, dir </> fnlcurry))
      else do
        curryExists <- doesFileExist (dir </> fncurry)
        if curryExists then return (Just (dir, dir </> fncurry))
                       else lookupSourceInPath dirs
demand: Info
 no demanded arguments
deterministic: Info
 deterministic operation
documentation: Info
 
Returns a directory name and the actual source file name for
a given module name (where a possible `curry` suffix is stripped off)
by looking up the module source in the load path provided as the
first argument.
If the module is hierarchical, the directory is the top directory
of the hierarchy.
Returns Nothing if there is no corresponding source file.
failfree: Info
 <FAILING>
indeterministic: Info
 referentially transparent operation
infix: Info
 no fixity defined
iotype: Info
 {(_,_) |-> _}
name: Info
 lookupModuleSource
precedence: Info
 no precedence defined
result-values: Info
 _
signature: Info
 [String] -> String -> Prelude.IO (Prelude.Maybe (String, String))
solution-complete: Info
 operation might suspend on free variables
terminating: Info
 possibly non-terminating
totally-defined: Info
 possibly non-reducible on same data term