debian-3.23: Modules for working with the Debian package systemSource codeContentsIndex
Debian.Repo.IO
Contents
AptIO Monad
State
Description
AptIO is an instance of the RWS monad used to manage the global state and output style parameters of clients of the Apt library, such as the autobuilder.
Synopsis
type AptIOT = RWST () () IOState
io :: CIO m => IO a -> AptIOT m a
tio :: CIO m => m a -> AptIOT m a
runAptIO :: CIO m => AptIOT m a -> m a
tryAB :: AptIO a -> AptIO (Either Exception a)
data IOState
setRepoMap :: Map URI (Maybe Repository) -> IOState -> IOState
getRepoMap :: IOState -> Map URI (Maybe Repository)
lookupRepository :: URI -> IOState -> Maybe Repository
insertRepository :: URI -> Repository -> IOState -> IOState
lookupAptImage :: SliceName -> IOState -> Maybe AptImage
insertAptImage :: SliceName -> AptImage -> IOState -> IOState
lookupSourcePackages :: FilePath -> IOState -> Maybe (FileStatus, [SourcePackage])
insertSourcePackages :: FilePath -> (FileStatus, [SourcePackage]) -> IOState -> IOState
lookupBinaryPackages :: FilePath -> IOState -> Maybe (FileStatus, [BinaryPackage])
insertBinaryPackages :: FilePath -> (FileStatus, [BinaryPackage]) -> IOState -> IOState
readParagraphs :: FilePath -> IO [Paragraph]
findRelease :: Repository -> ReleaseName -> IOState -> Maybe Release
putRelease :: Repository -> ReleaseName -> Release -> IOState -> IOState
countTasks :: CIO m => [(String, m a)] -> m [a]
Documentation
type AptIOT = RWST () () IOStateSource
A new monad to support the IO requirements of the autobuilder. This uses the RWS monad. The reader monad is used to store a flag indicating whether this is a dry run, and the style information associated with each output handle, including indentation, prefixing, and replacing the output with one dot per n output characters. The state monad stores information used to implement the current output style and includes state information about whether the console is at the beginning of a line, per-handle state information, and a cache of the repositories that have been verified.
AptIO Monad
io :: CIO m => IO a -> AptIOT m aSource
mark an action that should be run in the regular IO monad
tio :: CIO m => m a -> AptIOT m aSource
mark an action that should be run in the terminal IO monad
runAptIO :: CIO m => AptIOT m a -> m aSource
Perform an AptIO monad task in the IO monad.
tryAB :: AptIO a -> AptIO (Either Exception a)Source
Implementation of try for the AptIO monad. If the task throws an exception the initial state will be restored.
State
data IOState Source
This represents the state of the IO system. The bol flag keeps track of whether we are at the beginning of line on the console. This is computed in terms of what we have sent to the console, but it should be remembered that the order that stdout and stderr are sent to the console may not be the same as the order in which they show up there. However, this appears to server our purposes for now.
setRepoMap :: Map URI (Maybe Repository) -> IOState -> IOStateSource
getRepoMap :: IOState -> Map URI (Maybe Repository)Source
lookupRepository :: URI -> IOState -> Maybe RepositorySource
insertRepository :: URI -> Repository -> IOState -> IOStateSource
lookupAptImage :: SliceName -> IOState -> Maybe AptImageSource
insertAptImage :: SliceName -> AptImage -> IOState -> IOStateSource
lookupSourcePackages :: FilePath -> IOState -> Maybe (FileStatus, [SourcePackage])Source
insertSourcePackages :: FilePath -> (FileStatus, [SourcePackage]) -> IOState -> IOStateSource
lookupBinaryPackages :: FilePath -> IOState -> Maybe (FileStatus, [BinaryPackage])Source
insertBinaryPackages :: FilePath -> (FileStatus, [BinaryPackage]) -> IOState -> IOStateSource
readParagraphs :: FilePath -> IO [Paragraph]Source
findRelease :: Repository -> ReleaseName -> IOState -> Maybe ReleaseSource
putRelease :: Repository -> ReleaseName -> Release -> IOState -> IOStateSource
countTasks :: CIO m => [(String, m a)] -> m [a]Source
Perform a list of tasks with log messages.
Produced by Haddock version 2.4.2