hup-0.1.0.0: Upload packages or documentation to a hackage server

Safe HaskellSafe
LanguageHaskell2010

Distribution.Hup.Parse

Description

extract info from cabal files and .tgz names.

Synopsis

Documentation

rstrip :: String -> String Source #

strip whitespace from end

lstrip :: String -> String Source #

strip whitespace from beginning

replace :: Eq a => [a] -> [a] -> [a] -> [a] Source #

Replace a subsequence everywhere it occurs. The first argument must not be the empty list.

from NDM's extra-1.5.1 https://hackage.haskell.org/package/extra-1.5.1

replace "el" "_" "Hello Bella" == "H_lo B_la"
replace "el" "e" "Hello"       == "Helo"
replace "" "e" "Hello"         == undefined
\xs ys -> not (null xs) ==> replace xs xs ys == ys

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

Like dropWhileEnd, but for take.

(taken from filepath-1.4.1.1)

spanEnd :: (a -> Bool) -> [a] -> ([a], [a]) Source #

like span, but from the end

breakEnd :: (a -> Bool) -> [a] -> ([a], [a]) Source #

like break, but from the end

findCabal :: IO (Maybe FilePath) Source #

if there's a .cabal file in the current dir, return its file name.

from NDM's neil-0.10, https://hackage.haskell.org/package/neil-0.10

readCabal :: IO String Source #

find & read contents of Cabal file from current dir, if it exists. else returns empty string.

from NDM's neil-0.10, https://hackage.haskell.org/package/neil-0.10

extractCabal :: String -> String -> String Source #

extractCabal fieldName cabalConts: extract contents of field named fieldName from a Cabal file string.

field name is case-insensitive [folded to lowercase]

from NDM's neil-0.10, https://hackage.haskell.org/package/neil-0.10

parseTgzFilename :: (IsString s, MonadError s m) => FilePath -> m (IsDocumentation, Package) Source #

Inspect the name of a .tar.gz file to work out the package name and version it's for, and whether it is for documentation or a package.