stack-1.4.0: The Haskell Tool Stack

Safe Haskell | None
Language | Haskell2010

Stack.Dot

Synopsis

- dot :: (StackM env m, HasEnvConfig env, MonadBaseUnlift IO m) => DotOpts -> m ()
- listDependencies :: (StackM env m, HasEnvConfig env, MonadBaseUnlift IO m) => ListDepsOpts -> m ()
- data DotOpts = DotOpts {
  - dotIncludeExternal :: !Bool
  - dotIncludeBase :: !Bool
  - dotDependencyDepth :: !(Maybe Int)
  - dotPrune :: !(Set String)
  - dotTargets :: [Text]
  - dotFlags :: !(Map (Maybe PackageName) (Map FlagName Bool))
  - dotTestTargets :: Bool
  - dotBenchTargets :: Bool
  }
- data DotPayload = DotPayload {
  - payloadVersion :: Maybe Version
  - payloadLicense :: Maybe License
  }
- data ListDepsOpts = ListDepsOpts {
  - listDepsDotOpts :: !DotOpts
  - listDepsSep :: !Text
  - listDepsLicense :: !Bool
  }
- resolveDependencies :: (Applicative m, Monad m) => Maybe Int -> Map PackageName (Set PackageName, DotPayload) -> (PackageName -> m (Set PackageName, DotPayload)) -> m (Map PackageName (Set PackageName, DotPayload))
- printGraph :: (Applicative m, MonadIO m) => DotOpts -> Set PackageName -> Map PackageName (Set PackageName, DotPayload) -> m ()
- pruneGraph :: (Foldable f, Foldable g, Eq a) => f PackageName -> g String -> Map PackageName (Set PackageName, a) -> Map PackageName (Set PackageName, a)

# Documentation

dot :: (StackM env m, HasEnvConfig env, MonadBaseUnlift IO m) => DotOpts -> m () #

Visualize the project's dependencies as a graphviz graph

listDependencies :: (StackM env m, HasEnvConfig env, MonadBaseUnlift IO m) => ListDepsOpts -> m () #

data DotOpts #

Options record for `stack dot`

Constructors

DotOpts |
Fields dotIncludeExternal :: !Bool Include external dependencies dotIncludeBase :: !Bool Include dependencies on base dotDependencyDepth :: !(Maybe Int) Limit the depth of dependency resolution to (Just n) or continue until fixpoint dotPrune :: !(Set String) Package names to prune from the graph dotTargets :: [Text] stack TARGETs to trace dependencies for dotFlags :: !(Map (Maybe PackageName) (Map FlagName Bool)) Flags to apply when calculating dependencies dotTestTargets :: Bool Like the "--test" flag for build, affects the meaning of `dotTargets`. dotBenchTargets :: Bool Like the "--bench" flag for build, affects the meaning of `dotTargets`.

data DotPayload #

Information about a package in the dependency graph, when available.

Constructors

DotPayload |
Fields payloadVersion :: Maybe Version The package version. payloadLicense :: Maybe License The license the package was released under.

Instances

Eq DotPayload # |
Methods (==) :: DotPayload -> DotPayload -> Bool # (/=) :: DotPayload -> DotPayload -> Bool #
Show DotPayload # |
Methods showsPrec :: Int -> DotPayload -> ShowS # show :: DotPayload -> String # showList :: [DotPayload] -> ShowS #

data ListDepsOpts #

Constructors

ListDepsOpts |
Fields listDepsDotOpts :: !DotOpts The normal dot options. listDepsSep :: !Text Separator between the package name and details. listDepsLicense :: !Bool Print dependency licenses instead of versions.

resolveDependencies :: (Applicative m, Monad m) => Maybe Int -> Map PackageName (Set PackageName, DotPayload) -> (PackageName -> m (Set PackageName, DotPayload)) -> m (Map PackageName (Set PackageName, DotPayload)) #

Resolve the dependency graph up to (Just depth) or until fixpoint is reached

printGraph #

Arguments

:: (Applicative m, MonadIO m) |
=> DotOpts |
-> Set PackageName | all locals
-> Map PackageName (Set PackageName, DotPayload) |
-> m () |

Print a graphviz graph of the edges in the Map and highlight the given local packages

pruneGraph :: (Foldable f, Foldable g, Eq a) => f PackageName -> g String -> Map PackageName (Set PackageName, a) -> Map PackageName (Set PackageName, a) #

`pruneGraph dontPrune toPrune graph` prunes all packages in `graph` with a name in `toPrune` and removes resulting orphans unless they are in `dontPrune`