Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
extract info from cabal files and .tgz names.
- rstrip :: String -> String
- lstrip :: String -> String
- replace :: Eq a => [a] -> [a] -> [a] -> [a]
- takeWhileEnd :: (a -> Bool) -> [a] -> [a]
- spanEnd :: (a -> Bool) -> [a] -> ([a], [a])
- breakEnd :: (a -> Bool) -> [a] -> ([a], [a])
- findCabal :: IO (Maybe FilePath)
- readCabal :: IO String
- extractCabal :: String -> String -> String
- parseTgzFilename :: (IsString s, MonadError s m) => FilePath -> m (IsDocumentation, Package)
- parseTgzFilename' :: IsString s => FilePath -> Either s (IsDocumentation, Package)
- module Distribution.Hup.Types
Documentation
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)
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.
parseTgzFilename' :: IsString s => FilePath -> Either s (IsDocumentation, Package) Source #
parseTgzFilename'
specialized to Either
.
module Distribution.Hup.Types