Cabal-3.7.0.0: A framework for packaging Haskell software

Distribution.Simple.Program.Find

Description

A somewhat extended notion of the normal program search path concept.

Usually when finding executables we just want to look in the usual places using the OS's usual method for doing so. In Haskell the normal OS-specific method is captured by findExecutable. On all common OSs that makes use of a PATH environment variable, (though on Windows it is not just the PATH).

However it is sometimes useful to be able to look in additional locations without having to change the process-global PATH environment variable. So we need an extension of the usual findExecutable that can look in additional locations, either before, after or instead of the normal OS locations.

Synopsis

# Program search path

A search path to use when locating executables. This is analogous to the unix $PATH or win32 %PATH% but with the ability to use the system default method for finding executables (findExecutable which on unix is simply looking on the $PATH but on win32 is a bit more complicated).

The default to use is [ProgSearchPathDefault] but you can add extra dirs either before, after or instead of the default, e.g. here we add an extra dir to search after the usual ones.

['ProgramSearchPathDefault', 'ProgramSearchPathDir' dir]

Constructors

 ProgramSearchPathDir FilePath A specific dir ProgramSearchPathDefault The system default

#### Instances

Instances details
 Source # Instance detailsDefined in Distribution.Simple.Program.Find Methods Source # Instance detailsDefined in Distribution.Simple.Program.Find Associated Types Methods Source # Instance detailsDefined in Distribution.Simple.Program.Find Methods Source # Instance detailsDefined in Distribution.Simple.Program.Find Methods Source # Instance detailsDefined in Distribution.Simple.Program.Find type Rep ProgramSearchPathEntry = D1 ('MetaData "ProgramSearchPathEntry" "Distribution.Simple.Program.Find" "Cabal-3.7.0.0" 'False) (C1 ('MetaCons "ProgramSearchPathDir" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FilePath)) :+: C1 ('MetaCons "ProgramSearchPathDefault" 'PrefixI 'False) (U1 :: Type -> Type))

Interpret a ProgramSearchPath to construct a new $PATH env var. Note that this is close but not perfect because on Windows the search algorithm looks at more than just the %PATH%. Get the system search path. On Unix systems this is just the $PATH env var, but on windows it's a bit more complicated.