Safe Haskell | None |
---|---|
Language | Haskell98 |
- data Status
- data Progress = Progress {}
- data Task = Task {}
- isStatus :: Value -> Bool
- data Settings = Settings {
- database :: Async Database
- databaseCacheReader :: (FilePath -> ErrorT String IO Structured) -> IO (Maybe Database)
- databaseCacheWriter :: Database -> IO ()
- onStatus :: Task -> IO ()
- ghcOptions :: [String]
- data UpdateDB m a
- updateDB :: MonadIO m => Settings -> ErrorT String (UpdateDB m) () -> m ()
- postStatus :: (MonadIO m, MonadReader Settings m) => Task -> m ()
- waiter :: (MonadIO m, MonadReader Settings m) => m () -> m ()
- updater :: (MonadIO m, MonadReader Settings m, MonadWriter [ModuleLocation] m) => m Database -> m ()
- loadCache :: (MonadIO m, MonadReader Settings m, MonadWriter [ModuleLocation] m) => (FilePath -> ErrorT String IO Structured) -> m Database
- getCache :: (MonadIO m, MonadReader Settings m, MonadWriter [ModuleLocation] m) => (FilePath -> ErrorT String IO Structured) -> (Database -> Database) -> m Database
- runTask :: MonadIO m => String -> [Pair] -> ErrorT String (UpdateDB m) a -> ErrorT String (UpdateDB m) a
- runTasks :: Monad m => [ErrorT String (UpdateDB m) ()] -> ErrorT String (UpdateDB m) ()
- readDB :: (MonadIO m, MonadReader Settings m) => m Database
- scanModule :: (MonadIO m, MonadCatch m) => [String] -> ModuleLocation -> ErrorT String (UpdateDB m) ()
- scanModules :: (MonadIO m, MonadCatch m) => [String] -> [ModuleToScan] -> ErrorT String (UpdateDB m) ()
- scanFile :: (MonadIO m, MonadCatch m) => [String] -> FilePath -> ErrorT String (UpdateDB m) ()
- scanCabal :: (MonadIO m, MonadCatch m) => [String] -> Cabal -> ErrorT String (UpdateDB m) ()
- scanProjectFile :: (MonadIO m, MonadCatch m) => [String] -> FilePath -> ErrorT String (UpdateDB m) Project
- scanProject :: (MonadIO m, MonadCatch m) => [String] -> FilePath -> ErrorT String (UpdateDB m) ()
- scanDirectory :: (MonadIO m, MonadCatch m) => [String] -> FilePath -> ErrorT String (UpdateDB m) ()
- scan :: (MonadIO m, MonadCatch m) => (FilePath -> ErrorT String IO Structured) -> (Database -> Database) -> [ModuleToScan] -> [String] -> ([ModuleToScan] -> ErrorT String (UpdateDB m) ()) -> ErrorT String (UpdateDB m) ()
- liftErrorT :: MonadIO m => ErrorT String IO a -> ErrorT String m a
Documentation
Task | |
|
Settings | |
|
Monad m => MonadReader Settings (UpdateDB m) |
Monad m => MonadReader Settings (UpdateDB m) | |
Monad m => Monad (UpdateDB m) | |
Functor m => Functor (UpdateDB m) | |
Applicative m => Applicative (UpdateDB m) | |
MonadThrow m => MonadThrow (UpdateDB m) | |
MonadCatch m => MonadCatch (UpdateDB m) | |
MonadIO m => MonadIO (UpdateDB m) | |
Monad m => MonadWriter [ModuleLocation] (UpdateDB m) |
postStatus :: (MonadIO m, MonadReader Settings m) => Task -> m () Source
Post status
waiter :: (MonadIO m, MonadReader Settings m) => m () -> m () Source
Wait DB to complete actions
updater :: (MonadIO m, MonadReader Settings m, MonadWriter [ModuleLocation] m) => m Database -> m () Source
Update task result to database
loadCache :: (MonadIO m, MonadReader Settings m, MonadWriter [ModuleLocation] m) => (FilePath -> ErrorT String IO Structured) -> m Database Source
Get data from cache without updating DB
getCache :: (MonadIO m, MonadReader Settings m, MonadWriter [ModuleLocation] m) => (FilePath -> ErrorT String IO Structured) -> (Database -> Database) -> m Database Source
Load data from cache if not loaded yet and wait
runTask :: MonadIO m => String -> [Pair] -> ErrorT String (UpdateDB m) a -> ErrorT String (UpdateDB m) a Source
Run one task
runTasks :: Monad m => [ErrorT String (UpdateDB m) ()] -> ErrorT String (UpdateDB m) () Source
Run many tasks with numeration
scanModule :: (MonadIO m, MonadCatch m) => [String] -> ModuleLocation -> ErrorT String (UpdateDB m) () Source
Scan module
scanModules :: (MonadIO m, MonadCatch m) => [String] -> [ModuleToScan] -> ErrorT String (UpdateDB m) () Source
Scan modules
scanFile :: (MonadIO m, MonadCatch m) => [String] -> FilePath -> ErrorT String (UpdateDB m) () Source
Scan source file
scanCabal :: (MonadIO m, MonadCatch m) => [String] -> Cabal -> ErrorT String (UpdateDB m) () Source
Scan cabal modules
scanProjectFile :: (MonadIO m, MonadCatch m) => [String] -> FilePath -> ErrorT String (UpdateDB m) Project Source
Scan project file
scanProject :: (MonadIO m, MonadCatch m) => [String] -> FilePath -> ErrorT String (UpdateDB m) () Source
Scan project
scanDirectory :: (MonadIO m, MonadCatch m) => [String] -> FilePath -> ErrorT String (UpdateDB m) () Source
Scan directory for source files and projects
:: (MonadIO m, MonadCatch m) | |
=> (FilePath -> ErrorT String IO Structured) | Read data from cache |
-> (Database -> Database) | Get data from database |
-> [ModuleToScan] | Actual modules. Other modules will be removed from database |
-> [String] | Extra scan options |
-> ([ModuleToScan] -> ErrorT String (UpdateDB m) ()) | Function to update changed modules |
-> ErrorT String (UpdateDB m) () |
Generic scan function. Reads cache only if data is not already loaded, removes obsolete modules and rescans changed modules.