Safe Haskell | None |
---|---|
Language | Haskell2010 |
Distribution.Client.Glob
Synopsis
- data FilePathGlob = FilePathGlob FilePathRoot FilePathGlobRel
- data FilePathRoot
- data FilePathGlobRel
- type Glob = [GlobPiece]
- data GlobPiece
- matchFileGlob :: FilePath -> FilePathGlob -> IO [FilePath]
- matchFileGlobRel :: FilePath -> FilePathGlobRel -> IO [FilePath]
- matchGlob :: Glob -> String -> Bool
- isTrivialFilePathGlob :: FilePathGlob -> Maybe FilePath
- getFilePathRootDirectory :: FilePathRoot -> FilePath -> IO FilePath
Documentation
data FilePathGlob Source #
A file path specified by globbing
Constructors
FilePathGlob FilePathRoot FilePathGlobRel |
Instances
Parsec FilePathGlob Source # | |||||
Defined in Distribution.Client.Glob Methods parsec :: CabalParsing m => m FilePathGlob # | |||||
Pretty FilePathGlob Source # | |||||
Defined in Distribution.Client.Glob | |||||
Structured FilePathGlob Source # | |||||
Defined in Distribution.Client.Glob | |||||
Generic FilePathGlob Source # | |||||
Defined in Distribution.Client.Glob Associated Types
| |||||
Show FilePathGlob Source # | |||||
Defined in Distribution.Client.Glob Methods showsPrec :: Int -> FilePathGlob -> ShowS # show :: FilePathGlob -> String # showList :: [FilePathGlob] -> ShowS # | |||||
Binary FilePathGlob Source # | |||||
Defined in Distribution.Client.Glob | |||||
Eq FilePathGlob Source # | |||||
Defined in Distribution.Client.Glob | |||||
type Rep FilePathGlob Source # | |||||
Defined in Distribution.Client.Glob type Rep FilePathGlob = D1 ('MetaData "FilePathGlob" "Distribution.Client.Glob" "cabal-install-3.10.2.1-I7OdAmytDFVJvqp3SPFWoP" 'False) (C1 ('MetaCons "FilePathGlob" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FilePathRoot) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FilePathGlobRel))) |
data FilePathRoot Source #
Constructors
FilePathRelative | |
FilePathRoot FilePath | e.g. |
FilePathHomeDir |
Instances
Parsec FilePathRoot Source # | |||||
Defined in Distribution.Client.Glob Methods parsec :: CabalParsing m => m FilePathRoot # | |||||
Pretty FilePathRoot Source # | |||||
Defined in Distribution.Client.Glob | |||||
Structured FilePathRoot Source # | |||||
Defined in Distribution.Client.Glob | |||||
Generic FilePathRoot Source # | |||||
Defined in Distribution.Client.Glob Associated Types
| |||||
Show FilePathRoot Source # | |||||
Defined in Distribution.Client.Glob Methods showsPrec :: Int -> FilePathRoot -> ShowS # show :: FilePathRoot -> String # showList :: [FilePathRoot] -> ShowS # | |||||
Binary FilePathRoot Source # | |||||
Defined in Distribution.Client.Glob | |||||
Eq FilePathRoot Source # | |||||
Defined in Distribution.Client.Glob | |||||
type Rep FilePathRoot Source # | |||||
Defined in Distribution.Client.Glob type Rep FilePathRoot = D1 ('MetaData "FilePathRoot" "Distribution.Client.Glob" "cabal-install-3.10.2.1-I7OdAmytDFVJvqp3SPFWoP" 'False) (C1 ('MetaCons "FilePathRelative" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "FilePathRoot" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FilePath)) :+: C1 ('MetaCons "FilePathHomeDir" 'PrefixI 'False) (U1 :: Type -> Type))) |
data FilePathGlobRel Source #
Constructors
GlobDir !Glob !FilePathGlobRel | |
GlobFile !Glob | |
GlobDirTrailing | trailing dir, a glob ending in |
Instances
Parsec FilePathGlobRel Source # | |||||
Defined in Distribution.Client.Glob Methods parsec :: CabalParsing m => m FilePathGlobRel # | |||||
Pretty FilePathGlobRel Source # | |||||
Defined in Distribution.Client.Glob Methods pretty :: FilePathGlobRel -> Doc # prettyVersioned :: CabalSpecVersion -> FilePathGlobRel -> Doc # | |||||
Structured FilePathGlobRel Source # | |||||
Defined in Distribution.Client.Glob | |||||
Generic FilePathGlobRel Source # | |||||
Defined in Distribution.Client.Glob Associated Types
Methods from :: FilePathGlobRel -> Rep FilePathGlobRel x to :: Rep FilePathGlobRel x -> FilePathGlobRel | |||||
Show FilePathGlobRel Source # | |||||
Defined in Distribution.Client.Glob Methods showsPrec :: Int -> FilePathGlobRel -> ShowS # show :: FilePathGlobRel -> String # showList :: [FilePathGlobRel] -> ShowS # | |||||
Binary FilePathGlobRel Source # | |||||
Defined in Distribution.Client.Glob Methods put :: FilePathGlobRel -> Put # get :: Get FilePathGlobRel # putList :: [FilePathGlobRel] -> Put # | |||||
Eq FilePathGlobRel Source # | |||||
Defined in Distribution.Client.Glob Methods (==) :: FilePathGlobRel -> FilePathGlobRel -> Bool # (/=) :: FilePathGlobRel -> FilePathGlobRel -> Bool # | |||||
type Rep FilePathGlobRel Source # | |||||
Defined in Distribution.Client.Glob type Rep FilePathGlobRel = D1 ('MetaData "FilePathGlobRel" "Distribution.Client.Glob" "cabal-install-3.10.2.1-I7OdAmytDFVJvqp3SPFWoP" 'False) (C1 ('MetaCons "GlobDir" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Glob) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 FilePathGlobRel)) :+: (C1 ('MetaCons "GlobFile" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Glob)) :+: C1 ('MetaCons "GlobDirTrailing" 'PrefixI 'False) (U1 :: Type -> Type))) |
A piece of a globbing pattern
Instances
Structured GlobPiece Source # | |||||
Defined in Distribution.Client.Glob | |||||
Generic GlobPiece Source # | |||||
Defined in Distribution.Client.Glob Associated Types
| |||||
Show GlobPiece Source # | |||||
Binary GlobPiece Source # | |||||
Eq GlobPiece Source # | |||||
type Rep GlobPiece Source # | |||||
Defined in Distribution.Client.Glob type Rep GlobPiece = D1 ('MetaData "GlobPiece" "Distribution.Client.Glob" "cabal-install-3.10.2.1-I7OdAmytDFVJvqp3SPFWoP" '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 [Glob])))) |
matchFileGlob :: FilePath -> FilePathGlob -> IO [FilePath] Source #
Match a FilePathGlob
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.
matchFileGlobRel :: FilePath -> FilePathGlobRel -> IO [FilePath] Source #
Match a FilePathGlobRel
against the file system, starting from a
given root directory. The results are all relative to the given root.
isTrivialFilePathGlob :: FilePathGlob -> Maybe FilePath Source #
Check if a FilePathGlob
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
.
getFilePathRootDirectory Source #
Arguments
:: 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.