cabal-install
Safe HaskellNone
LanguageHaskell2010

Distribution.Client.Glob

Synopsis

cabal-install globbing features

data RootedGlob #

Instances

Instances details
Parsec RootedGlob # 
Instance details

Defined in Distribution.Simple.FileMonitor.Types

Methods

parsec :: CabalParsing m => m RootedGlob #

Pretty RootedGlob # 
Instance details

Defined in Distribution.Simple.FileMonitor.Types

Methods

pretty :: RootedGlob -> Doc #

prettyVersioned :: CabalSpecVersion -> RootedGlob -> Doc #

Structured RootedGlob # 
Instance details

Defined in Distribution.Simple.FileMonitor.Types

Methods

structure :: Proxy RootedGlob -> Structure

structureHash' :: Tagged RootedGlob MD5

Binary RootedGlob # 
Instance details

Defined in Distribution.Simple.FileMonitor.Types

Methods

put :: RootedGlob -> Put #

get :: Get RootedGlob #

putList :: [RootedGlob] -> Put #

Generic RootedGlob # 
Instance details

Defined in Distribution.Simple.FileMonitor.Types

Associated Types

type Rep RootedGlob 
Instance details

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)))

Methods

from :: RootedGlob -> Rep RootedGlob x

to :: Rep RootedGlob x -> RootedGlob

Show RootedGlob # 
Instance details

Defined in Distribution.Simple.FileMonitor.Types

Eq RootedGlob # 
Instance details

Defined in Distribution.Simple.FileMonitor.Types

type Rep RootedGlob # 
Instance details

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 #

Instances

Instances details
Parsec FilePathRoot # 
Instance details

Defined in Distribution.Simple.FileMonitor.Types

Pretty FilePathRoot # 
Instance details

Defined in Distribution.Simple.FileMonitor.Types

Methods

pretty :: FilePathRoot -> Doc #

prettyVersioned :: CabalSpecVersion -> FilePathRoot -> Doc #

Structured FilePathRoot # 
Instance details

Defined in Distribution.Simple.FileMonitor.Types

Methods

structure :: Proxy FilePathRoot -> Structure

structureHash' :: Tagged FilePathRoot MD5

Binary FilePathRoot # 
Instance details

Defined in Distribution.Simple.FileMonitor.Types

Methods

put :: FilePathRoot -> Put #

get :: Get FilePathRoot #

putList :: [FilePathRoot] -> Put #

Generic FilePathRoot # 
Instance details

Defined in Distribution.Simple.FileMonitor.Types

Associated Types

type Rep FilePathRoot 
Instance details

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)))
Show FilePathRoot # 
Instance details

Defined in Distribution.Simple.FileMonitor.Types

Eq FilePathRoot # 
Instance details

Defined in Distribution.Simple.FileMonitor.Types

type Rep FilePathRoot # 
Instance details

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

fileGlobMatches :: CabalSpecVersion -> Glob -> FilePath -> Maybe (GlobResult ()) #

globMatches :: [GlobResult a] -> [a] #

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] #

runDirFileGlob :: Verbosity -> Maybe CabalSpecVersion -> FilePath -> Glob -> IO [GlobResult FilePath] #

data GlobResult a #

Instances

Instances details
Functor GlobResult # 
Instance details

Defined in Distribution.Simple.Glob

Methods

fmap :: (a -> b) -> GlobResult a -> GlobResult b #

(<$) :: a -> GlobResult b -> GlobResult a #

Show a => Show (GlobResult a) # 
Instance details

Defined in Distribution.Simple.Glob

Eq a => Eq (GlobResult a) # 
Instance details

Defined in Distribution.Simple.Glob

Methods

(==) :: GlobResult a -> GlobResult a -> Bool #

(/=) :: GlobResult a -> GlobResult a -> Bool #

Ord a => Ord (GlobResult a) # 
Instance details

Defined in Distribution.Simple.Glob

data Glob #

Instances

Instances details
Parsec Glob # 
Instance details

Defined in Distribution.Simple.Glob.Internal

Methods

parsec :: CabalParsing m => m Glob #

Pretty Glob # 
Instance details

Defined in Distribution.Simple.Glob.Internal

Methods

pretty :: Glob -> Doc #

prettyVersioned :: CabalSpecVersion -> Glob -> Doc #

Structured Glob # 
Instance details

Defined in Distribution.Simple.Glob.Internal

Methods

structure :: Proxy Glob -> Structure

structureHash' :: Tagged Glob MD5

Binary Glob # 
Instance details

Defined in Distribution.Simple.Glob.Internal

Methods

put :: Glob -> Put #

get :: Get Glob #

putList :: [Glob] -> Put #

Generic Glob # 
Instance details

Defined in Distribution.Simple.Glob.Internal

Associated Types

type Rep Glob 
Instance details

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)))

Methods

from :: Glob -> Rep Glob x

to :: Rep Glob x -> Glob

Show Glob # 
Instance details

Defined in Distribution.Simple.Glob.Internal

Methods

showsPrec :: Int -> Glob -> ShowS #

show :: Glob -> String #

showList :: [Glob] -> ShowS #

Eq Glob # 
Instance details

Defined in Distribution.Simple.Glob.Internal

Methods

(==) :: Glob -> Glob -> Bool #

(/=) :: Glob -> Glob -> Bool #

type Rep Glob # 
Instance details

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)))

data Glob #

Instances

Instances details
Parsec Glob # 
Instance details

Defined in Distribution.Simple.Glob.Internal

Methods

parsec :: CabalParsing m => m Glob #

Pretty Glob # 
Instance details

Defined in Distribution.Simple.Glob.Internal

Methods

pretty :: Glob -> Doc #

prettyVersioned :: CabalSpecVersion -> Glob -> Doc #

Structured Glob # 
Instance details

Defined in Distribution.Simple.Glob.Internal

Methods

structure :: Proxy Glob -> Structure

structureHash' :: Tagged Glob MD5

Binary Glob # 
Instance details

Defined in Distribution.Simple.Glob.Internal

Methods

put :: Glob -> Put #

get :: Get Glob #

putList :: [Glob] -> Put #

Generic Glob # 
Instance details

Defined in Distribution.Simple.Glob.Internal

Associated Types

type Rep Glob 
Instance details

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)))

Methods

from :: Glob -> Rep Glob x

to :: Rep Glob x -> Glob

Show Glob # 
Instance details

Defined in Distribution.Simple.Glob.Internal

Methods

showsPrec :: Int -> Glob -> ShowS #

show :: Glob -> String #

showList :: [Glob] -> ShowS #

Eq Glob # 
Instance details

Defined in Distribution.Simple.Glob.Internal

Methods

(==) :: Glob -> Glob -> Bool #

(/=) :: Glob -> Glob -> Bool #

type Rep Glob # 
Instance details

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)))

data GlobPiece #

Instances

Instances details
Structured GlobPiece # 
Instance details

Defined in Distribution.Simple.Glob.Internal

Methods

structure :: Proxy GlobPiece -> Structure

structureHash' :: Tagged GlobPiece MD5

Binary GlobPiece # 
Instance details

Defined in Distribution.Simple.Glob.Internal

Methods

put :: GlobPiece -> Put #

get :: Get GlobPiece #

putList :: [GlobPiece] -> Put #

Generic GlobPiece # 
Instance details

Defined in Distribution.Simple.Glob.Internal

Associated Types

type Rep GlobPiece 
Instance details

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]))))

Methods

from :: GlobPiece -> Rep GlobPiece x

to :: Rep GlobPiece x -> GlobPiece

Show GlobPiece # 
Instance details

Defined in Distribution.Simple.Glob.Internal

Eq GlobPiece # 
Instance details

Defined in Distribution.Simple.Glob.Internal

type Rep GlobPiece # 
Instance details

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]))))

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.