hsdev-0.1.6.3: 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

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 -> ExceptT String IO Structured) -> m Database Source

Get data from cache without updating DB

getCache :: (MonadIO m, MonadReader Settings m, MonadWriter [ModuleLocation] m) => (FilePath -> ExceptT String IO Structured) -> (Database -> Database) -> m Database Source

Load data from cache if not loaded yet and wait

runTask :: (Display t, MonadIO m, NFData a, MonadCatchIO m) => String -> t -> ExceptT String (UpdateDB m) a -> ExceptT String (UpdateDB m) a Source

Run one task

runTasks :: Monad m => [ExceptT String (UpdateDB m) ()] -> ExceptT String (UpdateDB m) () Source

Run many tasks with numeration

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

Get database value

scanFile :: (MonadIO m, MonadCatch m, MonadCatchIO m) => [String] -> FilePath -> ExceptT String (UpdateDB m) () Source

Scan source file

scanFileContents :: (MonadIO m, MonadCatch m, MonadCatchIO m) => [String] -> FilePath -> Maybe String -> ExceptT String (UpdateDB m) () Source

Scan source file with contents

scanCabal :: (MonadIO m, MonadCatch m, MonadCatchIO m) => [String] -> Cabal -> ExceptT String (UpdateDB m) () Source

Scan cabal modules

scanDirectory :: (MonadIO m, MonadCatch m, MonadCatchIO m) => [String] -> FilePath -> ExceptT String (UpdateDB m) () Source

Scan directory for source files and projects

scanDocs :: (MonadIO m, MonadCatchIO m) => [InspectedModule] -> ExceptT String (UpdateDB m) () Source

Scan docs for inspected modules

scan Source

Arguments

:: (MonadIO m, MonadCatch m, MonadCatchIO m) 
=> (FilePath -> ExceptT 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] -> ExceptT String (UpdateDB m) ())

Function to update changed modules

-> ExceptT String (UpdateDB m) () 

Generic scan function. Reads cache only if data is not already loaded, removes obsolete modules and rescans changed modules.

Helpers

liftExceptT :: MonadIO m => ExceptT String IO a -> ExceptT String m a Source

Lift errors