Copyright | Isaac Jones Simon Marlow 2003-2004 |
---|---|
License | BSD3 portions Copyright (c) 2007, Galois Inc. |
Maintainer | cabal-devel@haskell.org |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
Distribution.Simple.Glob
Description
Simple file globbing.
Synopsis
- data GlobSyntaxError
- data GlobResult a
- = GlobMatch a
- | GlobWarnMultiDot a
- globMatches :: [GlobResult a] -> [a]
- matchFileGlob :: Verbosity -> Version -> FilePath -> IO [GlobResult FilePath]
- matchDirFileGlob :: Verbosity -> Version -> FilePath -> FilePath -> IO [GlobResult FilePath]
- matchDirFileGlob' :: Verbosity -> Version -> FilePath -> FilePath -> IO [GlobResult FilePath]
- fileGlobMatches :: Glob -> FilePath -> Maybe (GlobResult FilePath)
- parseFileGlob :: Version -> FilePath -> Either GlobSyntaxError Glob
- explainGlobSyntaxError :: FilePath -> GlobSyntaxError -> String
- data Glob
Documentation
data GlobSyntaxError Source #
Constructors
StarInDirectory | |
StarInFileName | |
StarInExtension | |
NoExtensionOnStar | |
EmptyGlob | |
LiteralFileNameGlobStar | |
VersionDoesNotSupportGlobStar | |
VersionDoesNotSupportGlob |
Instances
Eq GlobSyntaxError # | |
Defined in Distribution.Simple.Glob Methods (==) :: GlobSyntaxError -> GlobSyntaxError -> Bool # (/=) :: GlobSyntaxError -> GlobSyntaxError -> Bool # | |
Show GlobSyntaxError # | |
Defined in Distribution.Simple.Glob |
data GlobResult a Source #
Constructors
GlobMatch a | The glob matched the value supplied. |
GlobWarnMultiDot a | The glob did not match the value supplied because the cabal-version is too low and the extensions on the file did not precisely match the glob's extensions, but rather the glob was a proper suffix of the file's extensions; i.e., if not for the low cabal-version, it would have matched. |
Instances
Functor GlobResult # | |
Defined in Distribution.Simple.Glob Methods fmap :: (a -> b) -> GlobResult a -> GlobResult b Source # (<$) :: a -> GlobResult b -> GlobResult a Source # | |
Eq a => Eq (GlobResult a) # | |
Defined in Distribution.Simple.Glob | |
Ord a => Ord (GlobResult a) # | |
Defined in Distribution.Simple.Glob Methods compare :: GlobResult a -> GlobResult a -> Ordering # (<) :: GlobResult a -> GlobResult a -> Bool # (<=) :: GlobResult a -> GlobResult a -> Bool # (>) :: GlobResult a -> GlobResult a -> Bool # (>=) :: GlobResult a -> GlobResult a -> Bool # max :: GlobResult a -> GlobResult a -> GlobResult a # min :: GlobResult a -> GlobResult a -> GlobResult a # | |
Show a => Show (GlobResult a) # | |
Defined in Distribution.Simple.Glob |
globMatches :: [GlobResult a] -> [a] Source #
Extract the matches from a list of GlobResult
s.
matchFileGlob :: Verbosity -> Version -> FilePath -> IO [GlobResult FilePath] Source #
matchDirFileGlob :: Verbosity -> Version -> FilePath -> FilePath -> IO [GlobResult FilePath] Source #
Like matchDirFileGlob'
, but will die'
when the glob matches
no files.
matchDirFileGlob' :: Verbosity -> Version -> FilePath -> FilePath -> IO [GlobResult FilePath] Source #
Match files against a glob, starting in a directory.
The returned values do not include the supplied dir
prefix.
fileGlobMatches :: Glob -> FilePath -> Maybe (GlobResult FilePath) Source #
parseFileGlob :: Version -> FilePath -> Either GlobSyntaxError Glob Source #