| Portability | portable | 
|---|---|
| Stability | experimental | 
| Maintainer | Ralf Laemmel, Joost Visser | 
| Safe Haskell | None | 
Data.Generics.Strafunski.StrategyLib.ChaseImports
Contents
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.
- type ChaseName = String
 - chaseWith :: [FilePath] -> [ChaseName] -> [ChaseName] -> accu -> ([FilePath] -> ChaseName -> IO (Either cu String)) -> (cu -> [ChaseName]) -> (ChaseName -> [ChaseName] -> cu -> accu -> IO accu) -> (ChaseName -> accu -> IO accu) -> IO accu
 - chaseFile :: [FilePath] -> String -> [String] -> IO String
 - findFile :: [FilePath] -> String -> [String] -> IO FilePath
 
Type synonym
Generic import chasing
Arguments
| :: [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.