| 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 #
A file path specified by globbing
Constructors
| FilePathGlob FilePathRoot FilePathGlobRel |
Instances
data FilePathRoot #
Constructors
| FilePathRelative | |
| FilePathRoot FilePath | e.g. |
| FilePathHomeDir |
Instances
| Parsec FilePathRoot # | |||||
Defined in Distribution.Client.Glob Methods parsec :: CabalParsing m => m FilePathRoot # | |||||
| Pretty FilePathRoot # | |||||
Defined in Distribution.Client.Glob | |||||
| Structured FilePathRoot # | |||||
Defined in Distribution.Client.Glob | |||||
| Generic FilePathRoot # | |||||
Defined in Distribution.Client.Glob Associated Types
| |||||
| Show FilePathRoot # | |||||
Defined in Distribution.Client.Glob Methods showsPrec :: Int -> FilePathRoot -> ShowS # show :: FilePathRoot -> String # showList :: [FilePathRoot] -> ShowS # | |||||
| Binary FilePathRoot # | |||||
Defined in Distribution.Client.Glob | |||||
| Eq FilePathRoot # | |||||
Defined in Distribution.Client.Glob | |||||
| type Rep FilePathRoot # | |||||
Defined in Distribution.Client.Glob type Rep FilePathRoot = D1 ('MetaData "FilePathRoot" "Distribution.Client.Glob" "cabal-install-3.10.2.1-EH6AEtqwlbKE3rh89dIk81" '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 #
Constructors
| GlobDir !Glob !FilePathGlobRel | |
| GlobFile !Glob | |
| GlobDirTrailing | trailing dir, a glob ending in |
Instances
| Parsec FilePathGlobRel # | |||||
Defined in Distribution.Client.Glob Methods parsec :: CabalParsing m => m FilePathGlobRel # | |||||
| Pretty FilePathGlobRel # | |||||
Defined in Distribution.Client.Glob Methods pretty :: FilePathGlobRel -> Doc # prettyVersioned :: CabalSpecVersion -> FilePathGlobRel -> Doc # | |||||
| Structured FilePathGlobRel # | |||||
Defined in Distribution.Client.Glob Methods structure :: Proxy FilePathGlobRel -> Structure # structureHash' :: Tagged FilePathGlobRel MD5 | |||||
| Generic FilePathGlobRel # | |||||
Defined in Distribution.Client.Glob Associated Types
Methods from :: FilePathGlobRel -> Rep FilePathGlobRel x # to :: Rep FilePathGlobRel x -> FilePathGlobRel # | |||||
| Show FilePathGlobRel # | |||||
Defined in Distribution.Client.Glob Methods showsPrec :: Int -> FilePathGlobRel -> ShowS # show :: FilePathGlobRel -> String # showList :: [FilePathGlobRel] -> ShowS # | |||||
| Binary FilePathGlobRel # | |||||
Defined in Distribution.Client.Glob Methods put :: FilePathGlobRel -> Put # get :: Get FilePathGlobRel # putList :: [FilePathGlobRel] -> Put # | |||||
| Eq FilePathGlobRel # | |||||
Defined in Distribution.Client.Glob Methods (==) :: FilePathGlobRel -> FilePathGlobRel -> Bool # (/=) :: FilePathGlobRel -> FilePathGlobRel -> Bool # | |||||
| type Rep FilePathGlobRel # | |||||
Defined in Distribution.Client.Glob type Rep FilePathGlobRel = D1 ('MetaData "FilePathGlobRel" "Distribution.Client.Glob" "cabal-install-3.10.2.1-EH6AEtqwlbKE3rh89dIk81" '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 # | |||||
Defined in Distribution.Client.Glob | |||||
| Generic GlobPiece # | |||||
Defined in Distribution.Client.Glob Associated Types
| |||||
| Show GlobPiece # | |||||
| Binary GlobPiece # | |||||
| Eq GlobPiece # | |||||
| type Rep GlobPiece # | |||||
Defined in Distribution.Client.Glob type Rep GlobPiece = D1 ('MetaData "GlobPiece" "Distribution.Client.Glob" "cabal-install-3.10.2.1-EH6AEtqwlbKE3rh89dIk81" '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] #
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] #
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 #
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.
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.