StrategyLib-4.0.0.0ContentsIndex
Data.Generics.Strafunski.StrategyLib.ChaseImports
Portabilityportable
Stabilityexperimental
MaintainerRalf Laemmel, Joost Visser
Contents
Type synonym
Generic import chasing
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 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
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)
-> accuinitial (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 accuresult (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)
-> Stringbase name
-> [String]possible extensions
-> IO Stringcontents 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)
-> Stringbase name
-> [String]possible extensions
-> IO FilePathcontents 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