HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Modulecabal-install-3.12.1.0Haskell2010

Distribution.Client.Glob

  • 8 types
  • 13 values

cabal-install globbing features

4 declarations
datadata RootedGlob
#

A file path specified by globbing, relative to some root directory.

Instances8Eq, Show, Generic, Binary, Parsec, Pretty, …

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.

datadata FilePathRoot
#

Constructors

Instances8Eq, Show, Generic, Binary, Parsec, Pretty, …

Additional re-exports

17 declarations
datadata Glob
#

A filepath specified by globbing.

Instances8Eq, Show, Generic, Binary, Parsec, Pretty, …
datadata GlobResult a
#

Constructors

  • GlobMatch a

    The glob matched the value supplied.

  • GlobWarnMultiDot a

    The glob did not match the value supplied because the cabal-version is too low and the extensions on the file did not precisely match the glob's extensions, but rather the glob was a proper suffix of the file's extensions; i.e., if not for the low cabal-version, it would have matched.

  • GlobMissingDirectory a

    The glob couldn't match because the directory named doesn't exist. The directory will be as it appears in the glob (i.e., relative to the directory passed to matchDirFileGlob, and, for 'data-files', relative to 'data-dir').

  • GlobMatchesDirectory a

    The glob matched a directory when we were looking for files only. It didn't match a file!

Instances4Functor, Eq, Ord, Show
  • Functor GlobResultDefined in Cabal-3.12.1.0 · Distribution.Simple.Glob.Internal
  • Eq a => Eq (GlobResult a)Defined in Cabal-3.12.1.0 · Distribution.Simple.Glob.Internal
  • Ord a => Ord (GlobResult a)Defined in Cabal-3.12.1.0 · Distribution.Simple.Glob.Internal
  • Show a => Show (GlobResult a)Defined in Cabal-3.12.1.0 · Distribution.Simple.Glob.Internal
valueisRecursiveInRoot :: Glob -> Bool
#

Is the root of this relative glob path a directory-recursive wildcard, e.g. **/*.txt ?

valuerunDirFileGlob
  1. :: Verbosity
  2. -> Maybe CabalSpecVersion

    If the glob we are running should care about the cabal spec, and warnings such as GlobWarnMultiDot, then this should be the version. If you want to run a glob but don't care about any of the cabal-spec restrictions on globs, use Nothing!

  3. -> FilePath
  4. -> Glob
  5. -> IO [GlobResult FilePath]
#

Match files against a pre-parsed glob, starting in a directory.

The Version argument must be the spec version of the package description being processed, as globs behave slightly differently in different spec versions.

The FilePath argument is the directory that the glob is relative to. It must be a valid directory (and hence it can't be the empty string). The returned values will not include this prefix.

This will die' when the glob matches no files, or if the glob refers to a missing directory, or if the glob fails to parse.

The Version argument must be the spec version of the package description being processed, as globs behave slightly differently in different spec versions.

The first FilePath argument is the directory that the glob is relative to. It must be a valid directory (and hence it can't be the empty string). The returned values will not include this prefix.

The second FilePath is the glob itself.

datadata Glob
#

A filepath specified by globbing.

Constructors

Instances8Eq, Show, Generic, Binary, Parsec, Pretty, …
datadata GlobPiece
#

A piece of a globbing pattern

Constructors

Instances6Eq, Show, Generic, Binary, Structured, Rep
valuematchGlob :: FilePath -> Glob -> IO [FilePath]
#

Match a Glob against the file system, starting from a given root directory. The results are all relative to the given root.

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.