| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Distribution.Client.Glob
Synopsis
- data RootedGlob = RootedGlob FilePathRoot Glob
- isTrivialRootedGlob :: RootedGlob -> Maybe FilePath
- data FilePathRoot
- getFilePathRootDirectory :: FilePathRoot -> FilePath -> IO FilePath
- explainGlobSyntaxError :: FilePath -> GlobSyntaxError -> String
- fileGlobMatches :: CabalSpecVersion -> Glob -> FilePath -> Maybe (GlobResult ())
- globMatches :: [GlobResult a] -> [a]
- isRecursiveInRoot :: Glob -> Bool
- matchDirFileGlob :: forall dir (allowAbs :: AllowAbsolute) (file :: FileOrDir). Verbosity -> CabalSpecVersion -> Maybe (SymbolicPath CWD ('Dir dir)) -> SymbolicPathX allowAbs dir file -> IO [SymbolicPathX allowAbs dir file]
- matchDirFileGlobWithDie :: forall dir (allowAbs :: AllowAbsolute) (file :: FileOrDir). Verbosity -> (forall res. Verbosity -> CabalException -> IO [res]) -> CabalSpecVersion -> Maybe (SymbolicPath CWD ('Dir dir)) -> SymbolicPathX allowAbs dir file -> IO [SymbolicPathX allowAbs dir file]
- matchGlob :: FilePath -> Glob -> IO [FilePath]
- matchGlobPieces :: GlobPieces -> String -> Bool
- parseFileGlob :: CabalSpecVersion -> FilePath -> Either GlobSyntaxError Glob
- runDirFileGlob :: Verbosity -> Maybe CabalSpecVersion -> FilePath -> Glob -> IO [GlobResult FilePath]
- data GlobResult a
- data GlobSyntaxError
- data Glob
- data Glob
- data GlobPiece
- = WildCard
- | Literal String
- | Union [GlobPieces]
- type GlobPieces = [GlobPiece]
- matchFileGlob :: FilePath -> RootedGlob -> IO [FilePath]
cabal-install globbing features
data RootedGlob #
Constructors
| RootedGlob FilePathRoot Glob |
Instances
| Parsec RootedGlob # | |||||
Defined in Distribution.Simple.FileMonitor.Types Methods parsec :: CabalParsing m => m RootedGlob # | |||||
| Pretty RootedGlob # | |||||
Defined in Distribution.Simple.FileMonitor.Types | |||||
| Structured RootedGlob # | |||||
Defined in Distribution.Simple.FileMonitor.Types | |||||
| Binary RootedGlob # | |||||
Defined in Distribution.Simple.FileMonitor.Types | |||||
| Generic RootedGlob # | |||||
Defined in Distribution.Simple.FileMonitor.Types Associated Types
| |||||
| Show RootedGlob # | |||||
Defined in Distribution.Simple.FileMonitor.Types Methods showsPrec :: Int -> RootedGlob -> ShowS # show :: RootedGlob -> String # showList :: [RootedGlob] -> ShowS # | |||||
| Eq RootedGlob # | |||||
Defined in Distribution.Simple.FileMonitor.Types | |||||
| type Rep RootedGlob # | |||||
Defined in Distribution.Simple.FileMonitor.Types type Rep RootedGlob = D1 ('MetaData "RootedGlob" "Distribution.Simple.FileMonitor.Types" "Cabal-3.14.1.0-1c71" 'False) (C1 ('MetaCons "RootedGlob" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FilePathRoot) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Glob))) | |||||
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 #
Constructors
| FilePathRelative | |
| FilePathRoot FilePath | |
| FilePathHomeDir |
Instances
| Parsec FilePathRoot # | |||||
Defined in Distribution.Simple.FileMonitor.Types Methods parsec :: CabalParsing m => m FilePathRoot # | |||||
| Pretty FilePathRoot # | |||||
Defined in Distribution.Simple.FileMonitor.Types | |||||
| Structured FilePathRoot # | |||||
Defined in Distribution.Simple.FileMonitor.Types | |||||
| Binary FilePathRoot # | |||||
Defined in Distribution.Simple.FileMonitor.Types | |||||
| Generic FilePathRoot # | |||||
Defined in Distribution.Simple.FileMonitor.Types Associated Types
| |||||
| Show FilePathRoot # | |||||
Defined in Distribution.Simple.FileMonitor.Types Methods showsPrec :: Int -> FilePathRoot -> ShowS # show :: FilePathRoot -> String # showList :: [FilePathRoot] -> ShowS # | |||||
| Eq FilePathRoot # | |||||
Defined in Distribution.Simple.FileMonitor.Types | |||||
| type Rep FilePathRoot # | |||||
Defined in Distribution.Simple.FileMonitor.Types type Rep FilePathRoot = D1 ('MetaData "FilePathRoot" "Distribution.Simple.FileMonitor.Types" "Cabal-3.14.1.0-1c71" '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))) | |||||
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.
Additional re-exports
explainGlobSyntaxError :: FilePath -> GlobSyntaxError -> String #
fileGlobMatches :: CabalSpecVersion -> Glob -> FilePath -> Maybe (GlobResult ()) #
globMatches :: [GlobResult a] -> [a] #
isRecursiveInRoot :: Glob -> Bool #
matchDirFileGlob :: forall dir (allowAbs :: AllowAbsolute) (file :: FileOrDir). Verbosity -> CabalSpecVersion -> Maybe (SymbolicPath CWD ('Dir dir)) -> SymbolicPathX allowAbs dir file -> IO [SymbolicPathX allowAbs dir file] #
matchDirFileGlobWithDie :: forall dir (allowAbs :: AllowAbsolute) (file :: FileOrDir). Verbosity -> (forall res. Verbosity -> CabalException -> IO [res]) -> CabalSpecVersion -> Maybe (SymbolicPath CWD ('Dir dir)) -> SymbolicPathX allowAbs dir file -> IO [SymbolicPathX allowAbs dir file] #
matchGlobPieces :: GlobPieces -> String -> Bool #
parseFileGlob :: CabalSpecVersion -> FilePath -> Either GlobSyntaxError Glob #
runDirFileGlob :: Verbosity -> Maybe CabalSpecVersion -> FilePath -> Glob -> IO [GlobResult FilePath] #
data GlobResult a #
Constructors
| GlobMatch a | |
| GlobWarnMultiDot a | |
| GlobMissingDirectory a | |
| GlobMatchesDirectory a |
Instances
| Functor GlobResult # | |
Defined in Distribution.Simple.Glob Methods fmap :: (a -> b) -> GlobResult a -> GlobResult b # (<$) :: a -> GlobResult b -> GlobResult a # | |
| Show a => Show (GlobResult a) # | |
Defined in Distribution.Simple.Glob Methods showsPrec :: Int -> GlobResult a -> ShowS # show :: GlobResult a -> String # showList :: [GlobResult a] -> ShowS # | |
| 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 # | |
data GlobSyntaxError #
Constructors
| StarInDirectory | |
| StarInFileName | |
| StarInExtension | |
| NoExtensionOnStar | |
| EmptyGlob | |
| LiteralFileNameGlobStar | |
| VersionDoesNotSupportGlobStar | |
| VersionDoesNotSupportGlob |
Instances
| Show GlobSyntaxError # | |
Defined in Distribution.Simple.Glob Methods showsPrec :: Int -> GlobSyntaxError -> ShowS # show :: GlobSyntaxError -> String # showList :: [GlobSyntaxError] -> ShowS # | |
| Eq GlobSyntaxError # | |
Defined in Distribution.Simple.Glob Methods (==) :: GlobSyntaxError -> GlobSyntaxError -> Bool # (/=) :: GlobSyntaxError -> GlobSyntaxError -> Bool # | |
Instances
| Parsec Glob # | |||||
Defined in Distribution.Simple.Glob.Internal Methods parsec :: CabalParsing m => m Glob # | |||||
| Pretty Glob # | |||||
Defined in Distribution.Simple.Glob.Internal | |||||
| Structured Glob # | |||||
Defined in Distribution.Simple.Glob.Internal | |||||
| Binary Glob # | |||||
| Generic Glob # | |||||
Defined in Distribution.Simple.Glob.Internal Associated Types
| |||||
| Show Glob # | |||||
| Eq Glob # | |||||
| type Rep Glob # | |||||
Defined in Distribution.Simple.Glob.Internal type Rep Glob = D1 ('MetaData "Glob" "Distribution.Simple.Glob.Internal" "Cabal-3.14.1.0-1c71" 'False) ((C1 ('MetaCons "GlobDir" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 GlobPieces) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Glob)) :+: C1 ('MetaCons "GlobDirRecursive" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 GlobPieces))) :+: (C1 ('MetaCons "GlobFile" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 GlobPieces)) :+: C1 ('MetaCons "GlobDirTrailing" 'PrefixI 'False) (U1 :: Type -> Type))) | |||||
Constructors
| GlobDir !GlobPieces !Glob | |
| GlobDirRecursive !GlobPieces | |
| GlobFile !GlobPieces | |
| GlobDirTrailing |
Instances
| Parsec Glob # | |||||
Defined in Distribution.Simple.Glob.Internal Methods parsec :: CabalParsing m => m Glob # | |||||
| Pretty Glob # | |||||
Defined in Distribution.Simple.Glob.Internal | |||||
| Structured Glob # | |||||
Defined in Distribution.Simple.Glob.Internal | |||||
| Binary Glob # | |||||
| Generic Glob # | |||||
Defined in Distribution.Simple.Glob.Internal Associated Types
| |||||
| Show Glob # | |||||
| Eq Glob # | |||||
| type Rep Glob # | |||||
Defined in Distribution.Simple.Glob.Internal type Rep Glob = D1 ('MetaData "Glob" "Distribution.Simple.Glob.Internal" "Cabal-3.14.1.0-1c71" 'False) ((C1 ('MetaCons "GlobDir" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 GlobPieces) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Glob)) :+: C1 ('MetaCons "GlobDirRecursive" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 GlobPieces))) :+: (C1 ('MetaCons "GlobFile" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 GlobPieces)) :+: C1 ('MetaCons "GlobDirTrailing" 'PrefixI 'False) (U1 :: Type -> Type))) | |||||
Constructors
| WildCard | |
| Literal String | |
| Union [GlobPieces] |
Instances
| Structured GlobPiece # | |||||
Defined in Distribution.Simple.Glob.Internal | |||||
| Binary GlobPiece # | |||||
| Generic GlobPiece # | |||||
Defined in Distribution.Simple.Glob.Internal Associated Types
| |||||
| Show 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.0-1c71" '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] #
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.