cabal-debian-4.36.1: Create a Debianization for a Cabal package

Debian.Debianize.Prelude

Contents

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 -> d Source #

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

stripWith :: (a -> Bool) -> [a] -> [a] Source #

strictReadF :: (Text -> r) -> FilePath -> IO r 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.

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.

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

cond :: t -> t -> Bool -> t Source #

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

Get directory contents minus dot files.

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

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

foldEmpty :: r -> ([a] -> r) -> [a] -> r Source #

maybeL :: Lens' a (Maybe b) -> Maybe b -> a -> a Source #

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

read' :: Read a => (String -> a) -> String -> a Source #

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

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

listElemLens :: (a -> Bool) -> Lens' [a] (Maybe a) Source #

maybeLens :: a -> Lens' a b -> Lens' (Maybe a) b Source #

fromEmpty :: Set a -> Set a -> Set a Source #

fromSingleton :: a -> ([a] -> a) -> Set a -> a Source #

(.?=) :: 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

This should probably be used in a lot of places.

# Orphan instances

 Source # MethodspPrintList :: PrettyLevel -> [PP PackageName] -> Doc # Source # Methods