CurryInfo: currypath-3.0.0 / System.CurryPath.curryModulesInDirectory

definition: Info
 
curryModulesInDirectory :: String -> IO [String]
curryModulesInDirectory dir = getModules "" dir
 where
  getModules p d = do
    exdir <- doesDirectoryExist d
    entries <- if exdir then getDirectoryContents d else return []
    let realentries = filter (\f -> length f >= 1 && head f /= '.') entries
        newprogs    = filter isCurryFile realentries
    subdirs <- mapM (\e -> do b <- doesDirectoryExist (d </> e)
                              return $ if b then [e] else [])
                    realentries
               >>= return . concat
    subdirentries <- mapM (\s -> getModules (p ++ s ++ ".") (d </> s)) subdirs
    return $ map ((p ++) . stripCurrySuffix) newprogs ++ concat subdirentries

  isCurryFile f = takeExtension f `elem` [".curry",".lcurry"]
demand: Info
 no demanded arguments
deterministic: Info
 deterministic operation
documentation: Info
 
---------------------------------------------------------------------------
Gets the names of all Curry modules contained in a given directory.
Modules in subdirectories are returned as hierarchical module names.
failfree: Info
 <FAILING>
indeterministic: Info
 referentially transparent operation
infix: Info
 no fixity defined
iotype: Info
 {(_) |-> _}
name: Info
 curryModulesInDirectory
precedence: Info
 no precedence defined
result-values: Info
 _
signature: Info
 String -> Prelude.IO [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