cabal-install-3.12.1.0: The command-line interface for Cabal and Hackage.

Copyright | (c) Duncan Coutts 2012 2015 2016
License | BSD-like
Maintainer | duncan@community.haskell.org
Safe Haskell | None
Language | Haskell2010

Distribution.Client.TargetSelector

Contents

- Target selectors
- Reading target selectors
  - non-IO

Description

Handling for user-specified target selectors.

Synopsis

- data TargetSelector
  - = TargetPackage TargetImplicitCwd [PackageId] (Maybe ComponentKindFilter)
  - | TargetPackageNamed PackageName (Maybe ComponentKindFilter)
  - | TargetAllPackages (Maybe ComponentKindFilter)
  - | TargetComponent PackageId ComponentName SubComponentTarget
  - | TargetComponentUnknown PackageName (Either UnqualComponentName ComponentName) SubComponentTarget
- data TargetImplicitCwd
  - = TargetImplicitCwd
  - | TargetExplicitNamed
- data ComponentKind
  - = LibKind
  - | FLibKind
  - | ExeKind
  - | TestKind
  - | BenchKind
- type ComponentKindFilter = ComponentKind
- data SubComponentTarget
  - = WholeComponent
  - | ModuleTarget ModuleName
  - | FileTarget FilePath
- data QualLevel
  - = QL1
  - | QL2
  - | QL3
  - | QLFull
- componentKind :: ComponentName -> ComponentKind
- readTargetSelectors :: [PackageSpecifier (SourcePackage (PackageLocation a))] -> Maybe ComponentKindFilter -> [String] -> IO (Either [TargetSelectorProblem] [TargetSelector])
- data TargetSelectorProblem
  - = TargetSelectorExpected TargetString [String] String
  - | TargetSelectorNoSuch TargetString [(Maybe (String, String), String, String, [String])]
  - | TargetSelectorAmbiguous TargetString [(TargetString, TargetSelector)]
  - | MatchingInternalError TargetString TargetSelector [(TargetString, [TargetSelector])]
  - | TargetSelectorUnrecognised String
  - | TargetSelectorNoCurrentPackage TargetString
  - | TargetSelectorNoTargetsInCwd Bool
  - | TargetSelectorNoTargetsInProject
  - | TargetSelectorNoScript TargetString
- reportTargetSelectorProblems :: Verbosity -> [TargetSelectorProblem] -> IO a
- showTargetSelector :: TargetSelector -> String
- data TargetString
  - = TargetString1 String
  - | TargetString2 String String
  - | TargetString3 String String String
  - | TargetString4 String String String String
  - | TargetString5 String String String String String
  - | TargetString7 String String String String String String String
- showTargetString :: TargetString -> String
- parseTargetString :: String -> Maybe TargetString
- readTargetSelectorsWith :: (Applicative m, Monad m) => DirActions m -> [PackageSpecifier (SourcePackage (PackageLocation a))] -> Maybe ComponentKindFilter -> [String] -> m (Either [TargetSelectorProblem] [TargetSelector])
- data DirActions (m :: Type -> Type) = DirActions {
  - doesFileExist :: FilePath -> m Bool
  - doesDirectoryExist :: FilePath -> m Bool
  - canonicalizePath :: FilePath -> m FilePath
  - getCurrentDirectory :: m FilePath
  }
- defaultDirActions :: DirActions IO

# Target selectors

data TargetSelector #

A target selector is expression selecting a set of components (as targets for a actions like `build`, `run`, `test` etc). A target selector corresponds to the user syntax for referring to targets on the command line.

From the users point of view a target can be many things: packages, dirs, component names, files etc. Internally we consider a target to be a specific component (or module/file within a component), and all the users' notions of targets are just different ways of referring to these component targets.

So target selectors are expressions in the sense that they are interpreted to refer to one or more components. For example a `TargetPackage` gets interpreted differently by different commands to refer to all or a subset of components within the package.

The syntax has lots of optional parts:

    [ package name | package dir | package .cabal file ]
    [ [lib:|exe:] component name ]
    [ module name | source file ]

Constructors

TargetPackage TargetImplicitCwd [PackageId] (Maybe ComponentKindFilter) | One (or more) packages as a whole, or all the components of a particular kind within the package(s). These are always packages that are local to the project. In the case that there is more than one, they all share the same directory location.
TargetPackageNamed PackageName (Maybe ComponentKindFilter) | A package specified by name. This may refer to `extra-packages` from the `cabal.project` file, or a dependency of a known project package or could refer to a package from a hackage archive. It needs further context to resolve to a specific package.
TargetAllPackages (Maybe ComponentKindFilter) | All packages, or all components of a particular kind in all packages.
TargetComponent PackageId ComponentName SubComponentTarget | A specific component in a package within the project.
TargetComponentUnknown PackageName (Either UnqualComponentName ComponentName) SubComponentTarget | A component in a package, but where it cannot be verified that the package has such a component, or because the package is itself not known.

#### Instances

Instances details

Generic TargetSelector # |
Instance details Defined in Distribution.Client.TargetSelector Associated Types
type Rep TargetSelector |
Instance details Defined in Distribution.Client.TargetSelector type Rep TargetSelector = D1 ('MetaData "TargetSelector" "Distribution.Client.TargetSelector" "cabal-install-3.12.1.0-G554PkJj2SpDqyarXp9tbt" 'False) ((C1 ('MetaCons "TargetPackage" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 TargetImplicitCwd) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [PackageId]) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe ComponentKindFilter)))) :+: C1 ('MetaCons "TargetPackageNamed" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PackageName) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe ComponentKindFilter)))) :+: (C1 ('MetaCons "TargetAllPackages" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe ComponentKindFilter))) :+: (C1 ('MetaCons "TargetComponent" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PackageId) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ComponentName) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SubComponentTarget))) :+: C1 ('MetaCons "TargetComponentUnknown" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PackageName) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Either UnqualComponentName ComponentName)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SubComponentTarget))))))
Methods from :: TargetSelector -> Rep TargetSelector x # to :: Rep TargetSelector x -> TargetSelector #
Show TargetSelector # |
Instance details Defined in Distribution.Client.TargetSelector Methods showsPrec :: Int -> TargetSelector -> ShowS # show :: TargetSelector -> String # showList :: [TargetSelector] -> ShowS #
Eq TargetSelector # |
Instance details Defined in Distribution.Client.TargetSelector Methods (==) :: TargetSelector -> TargetSelector -> Bool # (/=) :: TargetSelector -> TargetSelector -> Bool #
Ord TargetSelector # |
Instance details Defined in Distribution.Client.TargetSelector Methods compare :: TargetSelector -> TargetSelector -> Ordering # (<) :: TargetSelector -> TargetSelector -> Bool # (<=) :: TargetSelector -> TargetSelector -> Bool # (>) :: TargetSelector -> TargetSelector -> Bool # (>=) :: TargetSelector -> TargetSelector -> Bool # max :: TargetSelector -> TargetSelector -> TargetSelector # min :: TargetSelector -> TargetSelector -> TargetSelector #
type Rep TargetSelector # |
Instance details Defined in Distribution.Client.TargetSelector type Rep TargetSelector = D1 ('MetaData "TargetSelector" "Distribution.Client.TargetSelector" "cabal-install-3.12.1.0-G554PkJj2SpDqyarXp9tbt" 'False) ((C1 ('MetaCons "TargetPackage" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 TargetImplicitCwd) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [PackageId]) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe ComponentKindFilter)))) :+: C1 ('MetaCons "TargetPackageNamed" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PackageName) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe ComponentKindFilter)))) :+: (C1 ('MetaCons "TargetAllPackages" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe ComponentKindFilter))) :+: (C1 ('MetaCons "TargetComponent" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PackageId) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ComponentName) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SubComponentTarget))) :+: C1 ('MetaCons "TargetComponentUnknown" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PackageName) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Either UnqualComponentName ComponentName)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SubComponentTarget))))))

data TargetImplicitCwd #

Does this `TargetPackage` selector arise from syntax referring to a package in the current directory (e.g. `tests` or no giving no explicit target at all) or does it come from syntax referring to a package name or location.

Constructors

TargetImplicitCwd |
TargetExplicitNamed |

#### Instances

Instances details

Generic TargetImplicitCwd # |
Instance details Defined in Distribution.Client.TargetSelector Associated Types
type Rep TargetImplicitCwd |
Instance details Defined in Distribution.Client.TargetSelector type Rep TargetImplicitCwd = D1 ('MetaData "TargetImplicitCwd" "Distribution.Client.TargetSelector" "cabal-install-3.12.1.0-G554PkJj2SpDqyarXp9tbt" 'False) (C1 ('MetaCons "TargetImplicitCwd" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "TargetExplicitNamed" 'PrefixI 'False) (U1 :: Type -> Type))
Methods from :: TargetImplicitCwd -> Rep TargetImplicitCwd x # to :: Rep TargetImplicitCwd x -> TargetImplicitCwd #
Show TargetImplicitCwd # |
Instance details Defined in Distribution.Client.TargetSelector Methods showsPrec :: Int -> TargetImplicitCwd -> ShowS # show :: TargetImplicitCwd -> String # showList :: [TargetImplicitCwd] -> ShowS #
Eq TargetImplicitCwd # |
Instance details Defined in Distribution.Client.TargetSelector Methods (==) :: TargetImplicitCwd -> TargetImplicitCwd -> Bool # (/=) :: TargetImplicitCwd -> TargetImplicitCwd -> Bool #
Ord TargetImplicitCwd # |
Instance details Defined in Distribution.Client.TargetSelector Methods compare :: TargetImplicitCwd -> TargetImplicitCwd -> Ordering # (<) :: TargetImplicitCwd -> TargetImplicitCwd -> Bool # (<=) :: TargetImplicitCwd -> TargetImplicitCwd -> Bool # (>) :: TargetImplicitCwd -> TargetImplicitCwd -> Bool # (>=) :: TargetImplicitCwd -> TargetImplicitCwd -> Bool # max :: TargetImplicitCwd -> TargetImplicitCwd -> TargetImplicitCwd # min :: TargetImplicitCwd -> TargetImplicitCwd -> TargetImplicitCwd #
type Rep TargetImplicitCwd # |
Instance details Defined in Distribution.Client.TargetSelector type Rep TargetImplicitCwd = D1 ('MetaData "TargetImplicitCwd" "Distribution.Client.TargetSelector" "cabal-install-3.12.1.0-G554PkJj2SpDqyarXp9tbt" 'False) (C1 ('MetaCons "TargetImplicitCwd" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "TargetExplicitNamed" 'PrefixI 'False) (U1 :: Type -> Type))

data ComponentKind #

Constructors

LibKind |
FLibKind |
ExeKind |
TestKind |
BenchKind |

#### Instances

Instances details

Enum ComponentKind # |
Instance details Defined in Distribution.Client.TargetSelector Methods succ :: ComponentKind -> ComponentKind # pred :: ComponentKind -> ComponentKind # toEnum :: Int -> ComponentKind # fromEnum :: ComponentKind -> Int # enumFrom :: ComponentKind -> [ComponentKind] # enumFromThen :: ComponentKind -> ComponentKind -> [ComponentKind] # enumFromTo :: ComponentKind -> ComponentKind -> [ComponentKind] # enumFromThenTo :: ComponentKind -> ComponentKind -> ComponentKind -> [ComponentKind] #
Show ComponentKind # |
Instance details Defined in Distribution.Client.TargetSelector Methods showsPrec :: Int -> ComponentKind -> ShowS # show :: ComponentKind -> String # showList :: [ComponentKind] -> ShowS #
Eq ComponentKind # |
Instance details Defined in Distribution.Client.TargetSelector Methods (==) :: ComponentKind -> ComponentKind -> Bool # (/=) :: ComponentKind -> ComponentKind -> Bool #
Ord ComponentKind # |
Instance details Defined in Distribution.Client.TargetSelector Methods compare :: ComponentKind -> ComponentKind -> Ordering # (<) :: ComponentKind -> ComponentKind -> Bool # (<=) :: ComponentKind -> ComponentKind -> Bool # (>) :: ComponentKind -> ComponentKind -> Bool # (>=) :: ComponentKind -> ComponentKind -> Bool # max :: ComponentKind -> ComponentKind -> ComponentKind # min :: ComponentKind -> ComponentKind -> ComponentKind #

type ComponentKindFilter = ComponentKind #

data SubComponentTarget #

Either the component as a whole or detail about a file or module target within a component.

Constructors

WholeComponent | The component as a whole
ModuleTarget ModuleName | A specific module within a component.
FileTarget FilePath | A specific file within a component. Note that this does not carry the file extension.

#### Instances

Instances details

Structured SubComponentTarget # |
Instance details Defined in Distribution.Client.TargetSelector Methods structure :: Proxy SubComponentTarget -> Structure # structureHash' :: Tagged SubComponentTarget MD5
Binary SubComponentTarget # |
Instance details Defined in Distribution.Client.TargetSelector Methods put :: SubComponentTarget -> Put # get :: Get SubComponentTarget # putList :: [SubComponentTarget] -> Put #
Generic SubComponentTarget # |
Instance details Defined in Distribution.Client.TargetSelector Associated Types
type Rep SubComponentTarget |
Instance details Defined in Distribution.Client.TargetSelector type Rep SubComponentTarget = D1 ('MetaData "SubComponentTarget" "Distribution.Client.TargetSelector" "cabal-install-3.12.1.0-G554PkJj2SpDqyarXp9tbt" 'False) (C1 ('MetaCons "WholeComponent" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "ModuleTarget" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ModuleName)) :+: C1 ('MetaCons "FileTarget" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FilePath))))
Methods from :: SubComponentTarget -> Rep SubComponentTarget x # to :: Rep SubComponentTarget x -> SubComponentTarget #
Show SubComponentTarget # |
Instance details Defined in Distribution.Client.TargetSelector Methods showsPrec :: Int -> SubComponentTarget -> ShowS # show :: SubComponentTarget -> String # showList :: [SubComponentTarget] -> ShowS #
Eq SubComponentTarget # |
Instance details Defined in Distribution.Client.TargetSelector Methods (==) :: SubComponentTarget -> SubComponentTarget -> Bool # (/=) :: SubComponentTarget -> SubComponentTarget -> Bool #
Ord SubComponentTarget # |
Instance details Defined in Distribution.Client.TargetSelector Methods compare :: SubComponentTarget -> SubComponentTarget -> Ordering # (<) :: SubComponentTarget -> SubComponentTarget -> Bool # (<=) :: SubComponentTarget -> SubComponentTarget -> Bool # (>) :: SubComponentTarget -> SubComponentTarget -> Bool # (>=) :: SubComponentTarget -> SubComponentTarget -> Bool # max :: SubComponentTarget -> SubComponentTarget -> SubComponentTarget # min :: SubComponentTarget -> SubComponentTarget -> SubComponentTarget #
type Rep SubComponentTarget # |
Instance details Defined in Distribution.Client.TargetSelector type Rep SubComponentTarget = D1 ('MetaData "SubComponentTarget" "Distribution.Client.TargetSelector" "cabal-install-3.12.1.0-G554PkJj2SpDqyarXp9tbt" 'False) (C1 ('MetaCons "WholeComponent" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "ModuleTarget" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ModuleName)) :+: C1 ('MetaCons "FileTarget" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FilePath))))

data QualLevel #

Qualification levels. Given the filepath src/F, executable component A, and package foo:

Constructors

QL1 |
    src/F
QL2 |
    foo:srcF | A:srcF
QL3 |
    foo:A:srcF | exe:A:srcF
QLFull |
    pkg:foo:exe:A:file:src/F

#### Instances

Instances details

Enum QualLevel # |
Instance details Defined in Distribution.Client.TargetSelector Methods succ :: QualLevel -> QualLevel # pred :: QualLevel -> QualLevel # toEnum :: Int -> QualLevel # fromEnum :: QualLevel -> Int # enumFrom :: QualLevel -> [QualLevel] # enumFromThen :: QualLevel -> QualLevel -> [QualLevel] # enumFromTo :: QualLevel -> QualLevel -> [QualLevel] # enumFromThenTo :: QualLevel -> QualLevel -> QualLevel -> [QualLevel] #
Show QualLevel # |
Instance details Defined in Distribution.Client.TargetSelector Methods showsPrec :: Int -> QualLevel -> ShowS # show :: QualLevel -> String # showList :: [QualLevel] -> ShowS #
Eq QualLevel # |
Instance details Defined in Distribution.Client.TargetSelector Methods (==) :: QualLevel -> QualLevel -> Bool # (/=) :: QualLevel -> QualLevel -> Bool #

componentKind :: ComponentName -> ComponentKind #

# Reading target selectors

readTargetSelectors #

Arguments

:: [PackageSpecifier (SourcePackage (PackageLocation a))] |
-> Maybe ComponentKindFilter | This parameter is used when there are ambiguous selectors. If it is `Just`, then we attempt to resolve ambiguity by applying it, since otherwise there is no way to allow contextually valid yet syntactically ambiguous selectors. (#4676, #5461)
-> [String] |
-> IO (Either [TargetSelectorProblem] [TargetSelector]) |

Parse a bunch of command line args as `TargetSelector`s, failing with an error if any are unrecognised. The possible target selectors are based on the available packages (and their locations).

data TargetSelectorProblem #

The various ways that trying to resolve a `TargetString` to a `TargetSelector` can fail.

Constructors

TargetSelectorExpected TargetString [String] String | expected thing (actually got)
TargetSelectorNoSuch TargetString [(Maybe (String, String), String, String, [String])] | ([in thing , no such thing, actually got, alternatives)]
TargetSelectorAmbiguous TargetString [(TargetString, TargetSelector)] |
MatchingInternalError TargetString TargetSelector [(TargetString, [TargetSelector])] |
TargetSelectorUnrecognised String | Syntax error when trying to parse a target string.
TargetSelectorNoCurrentPackage TargetString |
TargetSelectorNoTargetsInCwd Bool | bool that flags when it is acceptable to suggest "all" as a target
TargetSelectorNoTargetsInProject |
TargetSelectorNoScript TargetString |

#### Instances

Instances details

Show TargetSelectorProblem # |
Instance details Defined in Distribution.Client.TargetSelector Methods showsPrec :: Int -> TargetSelectorProblem -> ShowS # show :: TargetSelectorProblem -> String # showList :: [TargetSelectorProblem] -> ShowS #
Eq TargetSelectorProblem # |
Instance details Defined in Distribution.Client.TargetSelector Methods (==) :: TargetSelectorProblem -> TargetSelectorProblem -> Bool # (/=) :: TargetSelectorProblem -> TargetSelectorProblem -> Bool #

reportTargetSelectorProblems :: Verbosity -> [TargetSelectorProblem] -> IO a #

Throw an exception with a formatted message if there are any problems.

showTargetSelector :: TargetSelector -> String #

data TargetString #

The outline parse of a target selector. It takes one of the forms:

    str1
    str1:str2
    str1:str2:str3
    str1:str2:str3:str4

Constructors

TargetString1 String |
TargetString2 String String |
TargetString3 String String String |
TargetString4 String String String String |
TargetString5 String String String String String |
TargetString7 String String String String String String String |

#### Instances

Instances details

Show TargetString # |
Instance details Defined in Distribution.Client.TargetSelector Methods showsPrec :: Int -> TargetString -> ShowS # show :: TargetString -> String # showList :: [TargetString] -> ShowS #
Eq TargetString # |
Instance details Defined in Distribution.Client.TargetSelector Methods (==) :: TargetString -> TargetString -> Bool # (/=) :: TargetString -> TargetString -> Bool #

showTargetString :: TargetString -> String #

Render a `TargetString` back as the external syntax. This is mainly for error messages.

parseTargetString :: String -> Maybe TargetString #

## non-IO

readTargetSelectorsWith :: (Applicative m, Monad m) => DirActions m -> [PackageSpecifier (SourcePackage (PackageLocation a))] -> Maybe ComponentKindFilter -> [String] -> m (Either [TargetSelectorProblem] [TargetSelector]) #

data DirActions (m :: Type -> Type) #

Constructors

DirActions |
Fields doesFileExist :: FilePath -> m Bool doesDirectoryExist :: FilePath -> m Bool canonicalizePath :: FilePath -> m FilePath getCurrentDirectory :: m FilePath

defaultDirActions :: DirActions IO #