Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data RootedGlob = RootedGlob FilePathRoot Glob
- isTrivialRootedGlob :: RootedGlob -> Maybe FilePath
- data FilePathRoot
- getFilePathRootDirectory :: FilePathRoot -> FilePath -> IO FilePath
- module Distribution.Simple.Glob
- data Glob
- data GlobPiece
- = WildCard
- | Literal String
- | Union [GlobPieces]
- type GlobPieces = [GlobPiece]
- matchFileGlob :: FilePath -> RootedGlob -> IO [FilePath]
cabal-install globbing features
data RootedGlob #
A file path specified by globbing, relative to some root directory.
RootedGlob | |
|
Instances
isTrivialRootedGlob :: RootedGlob -> Maybe FilePath Source #
Check if a RootedGlob
doesn't actually make use of any globbing and
is in fact equivalent to a non-glob FilePath
.
If it is trivial in this sense then the result is the equivalent constant
FilePath
. On the other hand, if it is not trivial (so could in principle
match more than one file), then the result is Nothing
.
data FilePathRoot #
FilePathRelative | |
FilePathRoot FilePath | e.g. |
FilePathHomeDir |
Instances
getFilePathRootDirectory Source #
:: FilePathRoot | |
-> FilePath | root for relative paths |
-> IO FilePath |
Get the FilePath
corresponding to a FilePathRoot
.
The FilePath
argument is required to supply the path for the
FilePathRelative
case.
Additional re-exports
module Distribution.Simple.Glob
A filepath specified by globbing.
GlobDir !GlobPieces !Glob | dirGlob/glob |
GlobDirRecursive !GlobPieces |
|
GlobFile !GlobPieces | A file glob. |
GlobDirTrailing | Trailing dir; a glob ending in |
Instances
A piece of a globbing pattern
WildCard | A wildcard |
Literal String | A literal string |
Union [GlobPieces] | A union of patterns, e.g. |
Instances
Structured GlobPiece | |
Defined in Distribution.Simple.Glob.Internal | |
Generic GlobPiece | |
Show GlobPiece | |
Binary GlobPiece | |
Eq GlobPiece | |
type Rep GlobPiece | |
Defined in Distribution.Simple.Glob.Internal type Rep GlobPiece = D1 ('MetaData "GlobPiece" "Distribution.Simple.Glob.Internal" "Cabal-3.14.1.1-KNG8xgahazw32ECV34zzCb" 'False) (C1 ('MetaCons "WildCard" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Literal" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)) :+: C1 ('MetaCons "Union" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [GlobPieces])))) |
type GlobPieces = [GlobPiece] #
A single directory or file component of a globbed path
matchFileGlob :: FilePath -> RootedGlob -> IO [FilePath] Source #
Match a RootedGlob
against the file system, starting from a given
root directory for relative paths. The results of relative globs are
relative to the given root. Matches for absolute globs are absolute.