hsdev-0.1.3.4: Haskell development library and tool with support of autocompletion, symbol info, go to declaration, find references etc.

Safe HaskellNone
LanguageHaskell98

HsDev.Database.Update

Contents

Synopsis

Documentation

updateDB :: MonadIO m => Settings -> ErrorT String (UpdateDB m) () -> m () Source

Run UpdateDB monad

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

readDB :: (MonadIO m, MonadReader Settings m) => m Database Source

Get database value

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

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

scan Source

Arguments

:: (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.

Helpers

liftErrorT :: MonadIO m => ErrorT String IO a -> ErrorT String m a Source

Lift errors