cabal-debian-4.0.4: Create a debianization for a cabal package

Safe HaskellNone

Debian.Debianize.Prelude

Description

Functions and instances used by but not related to cabal-debian. These could conceivably be moved into more general libraries.

Synopsis

Documentation

curry3 :: ((a, b, c) -> d) -> a -> b -> c -> dSource

buildDebVersionMap :: IO DebMapSource

Read and parse the status file for installed debian packages: varlibdpkgstatus

strictReadF :: (Text -> r) -> FilePath -> IO rSource

replaceFile :: FilePath -> String -> IO ()Source

Write a file which we might still be reading from in order to compute the text argument.

modifyFile :: FilePath -> (String -> IO (Maybe String)) -> IO ()Source

Compute the new file contents from the old. If f returns Nothing do not write.

dpkgFileMap :: IO (Map FilePath (Set BinPkgName))Source

Create a map from pathname to the names of the packages that contains that pathname using the contents of the debian package info directory varlibdpkginfo.

debOfFile :: FilePath -> ReaderT (Map FilePath (Set BinPkgName)) IO (Maybe BinPkgName)Source

Given a path, return the name of the package that owns it.

cond :: t -> t -> Bool -> tSource

withCurrentDirectory :: FilePath -> IO a -> IO aSource

From Darcs.Utils - set the working directory and run an IO operation.

getDirectoryContents' :: FilePath -> IO [FilePath]Source

Get directory contents minus dot files.

setMapMaybe :: (Ord a, Ord b) => (a -> Maybe b) -> Set a -> Set bSource

zipMaps :: Ord k => (k -> Maybe a -> Maybe b -> Maybe c) -> Map k a -> Map k b -> Map k cSource

foldEmpty :: r -> ([a] -> r) -> [a] -> rSource

maybeL :: Lens a (Maybe b) -> Maybe b -> a -> aSource

If the current value of getL x is Nothing, replace it with f.

read' :: Read a => (String -> a) -> String -> aSource

modifyM :: MonadState a m => (a -> m a) -> m ()Source

intToVerbosity' :: Int -> VerbositySource

Version of intToVerbosity that first clamps its argument to the acceptable range (0-3).

(~=) :: Monad m => Lens a b -> b -> StateT a m ()Source

Set a lens value. (This is a version of Data.Lens.Lazy.~= that returns () instead of b.)

(~?=) :: Monad m => Lens a (Maybe b) -> Maybe b -> StateT a m ()Source

Set b if it currently isNothing and the argument isJust, that is 1. Nothing happens if the argument isNothing 2. Nothing happens if the current value isJust

(%=) :: Monad m => Lens a b -> (b -> b) -> StateT a m ()Source

Modify a value. (This is a version of Data.Lens.Lazy.%= that returns () instead of a.)

(+=) :: (Monad m, Ord b) => Lens a (Set b) -> b -> StateT a m ()Source

Insert an element into a (Set b)

(++=) :: (Monad m, Ord b) => Lens a (Map b c) -> (b, c) -> StateT a m ()Source

Insert an element into a (Map b c)

(+++=) :: (Monad m, Ord b, Monoid c) => Lens a (Map b c) -> (b, c) -> StateT a m ()Source

Insert an element into a (Map b (Set c))

fromEmpty :: Set a -> Set a -> Set aSource

fromSingleton :: a -> ([a] -> a) -> Set a -> aSource

class Pretty a where

The member prettyList is only used to define the instance Pretty a => Pretty [a]. In normal circumstances only the pretty function is used.

Methods

pretty :: a -> Doc

Instances

Pretty Bool 
Pretty Char 
Pretty Double 
Pretty Float 
Pretty Int 
Pretty Integer 
Pretty () 
Pretty PackageName 
Pretty PackageIdentifier 
Pretty License 
Pretty VersionRange 
Pretty Version 
Pretty Doc 
Pretty Relation 
Pretty SrcPkgName 
Pretty BinPkgName 
Pretty ArchitectureReq 
Pretty VersionReq 
Pretty ChangesFile 
Pretty ChangedFileSpec 
Pretty ChangeLogEntry 
Pretty ChangeLog 
Pretty DebianVersion 
Pretty NameAddr 
Pretty Text 
Pretty Area 
Pretty Section 
Pretty PackageArchitectures 
Pretty PackagePriority 
Pretty SourceFormat 
Pretty StandardsVersion 
Pretty a => Pretty [a] 
Pretty a => Pretty (Maybe a) 
Pretty (Control' String)

This may have bad performance issues (why?)

Pretty (Control' Text)

parseFromFile p filePath runs a string parser p on the input read from filePath using readFile. Returns either a ParseError (Left) or a value of type a (Right).

  main    = do{ result <- parseFromFile numbers "digits.txt"
              ; case result of
                  Left err  -> print err
                  Right xs  -> print (sum xs)
              }

This may have bad performance issues (why?)

Pretty (Paragraph' String) 
Pretty (Paragraph' Text) 
Pretty (Field' String) 
Pretty (Field' Text) 
(Pretty a, Pretty b) => Pretty (a, b) 
(Pretty a, Pretty b, Pretty c) => Pretty (a, b, c)