HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

ModuleCabal-3.12.1.0Haskell2010

Distribution.Simple.Glob

Simple file globbing.

  • 3 types
  • 8 values
  • PackageCabal-3.12.1.0
  • Exports11
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceGlob.hs

Globs

1 declaration
datadata Glob
#

A filepath specified by globbing.

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

Matching on globs

6 declarations
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

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.

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.

Parsing globs

3 declarations

Utility

1 declaration
valueisRecursiveInRoot :: Glob -> Bool
#

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