cabal-install-3.10.1.0: The command-line interface for Cabal and Hackage.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Distribution.Client.Glob

Synopsis

Documentation

data FilePathGlob Source #

A file path specified by globbing

Instances

Instances details
Parsec FilePathGlob Source # 
Instance details

Defined in Distribution.Client.Glob

Pretty FilePathGlob Source # 
Instance details

Defined in Distribution.Client.Glob

Structured FilePathGlob Source # 
Instance details

Defined in Distribution.Client.Glob

Generic FilePathGlob Source # 
Instance details

Defined in Distribution.Client.Glob

Associated Types

type Rep FilePathGlob :: Type -> Type #

Show FilePathGlob Source # 
Instance details

Defined in Distribution.Client.Glob

Binary FilePathGlob Source # 
Instance details

Defined in Distribution.Client.Glob

Eq FilePathGlob Source # 
Instance details

Defined in Distribution.Client.Glob

type Rep FilePathGlob Source # 
Instance details

Defined in Distribution.Client.Glob

type Rep FilePathGlob = D1 ('MetaData "FilePathGlob" "Distribution.Client.Glob" "cabal-install-3.10.1.0-FbhGUvZ0l0XIx7QbOQfSVh" '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. "/", "c:" or result of takeDrive

FilePathHomeDir 

Instances

Instances details
Parsec FilePathRoot Source # 
Instance details

Defined in Distribution.Client.Glob

Pretty FilePathRoot Source # 
Instance details

Defined in Distribution.Client.Glob

Structured FilePathRoot Source # 
Instance details

Defined in Distribution.Client.Glob

Generic FilePathRoot Source # 
Instance details

Defined in Distribution.Client.Glob

Associated Types

type Rep FilePathRoot :: Type -> Type #

Show FilePathRoot Source # 
Instance details

Defined in Distribution.Client.Glob

Binary FilePathRoot Source # 
Instance details

Defined in Distribution.Client.Glob

Eq FilePathRoot Source # 
Instance details

Defined in Distribution.Client.Glob

type Rep FilePathRoot Source # 
Instance details

Defined in Distribution.Client.Glob

type Rep FilePathRoot = D1 ('MetaData "FilePathRoot" "Distribution.Client.Glob" "cabal-install-3.10.1.0-FbhGUvZ0l0XIx7QbOQfSVh" '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

Instances details
Parsec FilePathGlobRel Source # 
Instance details

Defined in Distribution.Client.Glob

Pretty FilePathGlobRel Source # 
Instance details

Defined in Distribution.Client.Glob

Structured FilePathGlobRel Source # 
Instance details

Defined in Distribution.Client.Glob

Generic FilePathGlobRel Source # 
Instance details

Defined in Distribution.Client.Glob

Associated Types

type Rep FilePathGlobRel :: Type -> Type #

Show FilePathGlobRel Source # 
Instance details

Defined in Distribution.Client.Glob

Binary FilePathGlobRel Source # 
Instance details

Defined in Distribution.Client.Glob

Eq FilePathGlobRel Source # 
Instance details

Defined in Distribution.Client.Glob

type Rep FilePathGlobRel Source # 
Instance details

Defined in Distribution.Client.Glob

type Rep FilePathGlobRel = D1 ('MetaData "FilePathGlobRel" "Distribution.Client.Glob" "cabal-install-3.10.1.0-FbhGUvZ0l0XIx7QbOQfSVh" '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)))

type Glob = [GlobPiece] Source #

A single directory or file component of a globbed path

data GlobPiece Source #

A piece of a globbing pattern

Constructors

WildCard 
Literal String 
Union [Glob] 

Instances

Instances details
Structured GlobPiece Source # 
Instance details

Defined in Distribution.Client.Glob

Generic GlobPiece Source # 
Instance details

Defined in Distribution.Client.Glob

Associated Types

type Rep GlobPiece :: Type -> Type #

Show GlobPiece Source # 
Instance details

Defined in Distribution.Client.Glob

Binary GlobPiece Source # 
Instance details

Defined in Distribution.Client.Glob

Eq GlobPiece Source # 
Instance details

Defined in Distribution.Client.Glob

type Rep GlobPiece Source # 
Instance details

Defined in Distribution.Client.Glob

type Rep GlobPiece = D1 ('MetaData "GlobPiece" "Distribution.Client.Glob" "cabal-install-3.10.1.0-FbhGUvZ0l0XIx7QbOQfSVh" '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.

matchGlob :: Glob -> String -> Bool Source #

Match a globbing pattern against a file path component

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.