|
Data.Generics.Strafunski.StrategyLib.ChaseImports | Portability | portable | Stability | experimental | Maintainer | Ralf Laemmel, Joost Visser |
|
|
|
|
|
Description |
This module is part of StrategyLib, a library of functional strategy
combinators, including combinators for generic traversal. This module
defines a generic algorithm for import chasing. This algorithm is not
strategic in nature itself, but usually it will be instantiated with
strategic functions for a particular object language.
|
|
Synopsis |
|
|
|
|
Type synonym
|
|
type ChaseName = String |
The type of names of chaseable things. Synonym of String.
|
|
Generic import chasing
|
|
chaseWith |
:: [FilePath] | path (list of directories to search)
| -> [ChaseName] | todo (list of modules still to find)
| -> [ChaseName] | done (list of modules already found)
| -> accu | initial (start value of accumulator)
| -> ([FilePath] -> ChaseName -> IO (Either cu String)) | parse (function that attempt to find and parse a module)
| -> (cu -> [ChaseName]) | imports (function that extracts imports from
a parse result)
| -> (ChaseName -> [ChaseName] -> cu -> accu -> IO accu) | on module (function that computes a new
accumulator from a parse result)
| -> (ChaseName -> accu -> IO accu) | on missing (function that computes a new
accumulator value when parsing failed)
| -> IO accu | result (accumulated value)
| A generic import chasing function. The type of the final result is a
parameter, which will usually be instantiated to a list of parsed
modules.
|
|
|
chaseFile |
:: [FilePath] | path (directories to search)
| -> String | base name
| -> [String] | possible extensions
| -> IO String | contents of file
| Read a file from a number of possible directories, given a
base name and a list of possible extensions. Returns the content
of the file it found.
|
|
|
findFile |
:: [FilePath] | path (directories to search)
| -> String | base name
| -> [String] | possible extensions
| -> IO FilePath | contents of file
| Find a file in a number of possible directories, given a
base name and a list of possible extensions. Returns the full
name of the file it found.
|
|
|
Produced by Haddock version 0.8 |