shrun
Safe HaskellNone
LanguageGHC2021

Shrun.Command.Types

Description

Provides the Command wrapper for commands.

Synopsis

Command

data CommandP (p :: CommandPhase) Source #

Wrapper for shell commands. Whenever the CommandIndex order is important, see CommandOrd.

Constructors

MkCommandP 

Fields

Instances

Instances details
(k ~ A_Lens, a ~ Text, b ~ Text) => LabelOptic "command" k (CommandP p) (CommandP p) a b Source # 
Instance details

Defined in Shrun.Command.Types

Methods

labelOptic :: Optic k NoIx (CommandP p) (CommandP p) a b Source #

(k ~ A_Lens, a ~ CommandIndex, b ~ CommandIndex) => LabelOptic "index" k (CommandP p) (CommandP p) a b Source # 
Instance details

Defined in Shrun.Command.Types

Methods

labelOptic :: Optic k NoIx (CommandP p) (CommandP p) a b Source #

(k ~ A_Lens, a ~ Maybe Text, b ~ Maybe Text) => LabelOptic "key" k (CommandP p) (CommandP p) a b Source # 
Instance details

Defined in Shrun.Command.Types

Methods

labelOptic :: Optic k NoIx (CommandP p) (CommandP p) a b Source #

NFData (CommandP p) Source # 
Instance details

Defined in Shrun.Command.Types

Methods

rnf :: CommandP p -> () #

Generic (CommandP p) Source # 
Instance details

Defined in Shrun.Command.Types

Associated Types

type Rep (CommandP p) 
Instance details

Defined in Shrun.Command.Types

Methods

from :: CommandP p -> Rep (CommandP p) x #

to :: Rep (CommandP p) x -> CommandP p #

Show (CommandP p) Source # 
Instance details

Defined in Shrun.Command.Types

Methods

showsPrec :: Int -> CommandP p -> ShowS #

show :: CommandP p -> String #

showList :: [CommandP p] -> ShowS #

Eq (CommandP p) Source # 
Instance details

Defined in Shrun.Command.Types

Methods

(==) :: CommandP p -> CommandP p -> Bool #

(/=) :: CommandP p -> CommandP p -> Bool #

Hashable (CommandP p) Source # 
Instance details

Defined in Shrun.Command.Types

type Rep (CommandP p) Source # 
Instance details

Defined in Shrun.Command.Types

type CommandP1 = CommandP 'CommandPhase1 Source #

Phase1 commands.

type CommandP2 = CommandP 'CommandPhase2 Source #

Phase2 commands.

Index

data CommandIndex Source #

Numeric index for each command, for handling command graph dependencies. Conversion to/from Vertex should use indexToVertex and indexFromVertex, as CommandIndex is 1-based whereas Vertex is 0-based.

Instances

Instances details
ASemigroup CommandIndex Source # 
Instance details

Defined in Shrun.Command.Types.Internal

MMonoid CommandIndex Source # 
Instance details

Defined in Shrun.Command.Types.Internal

MSemigroup CommandIndex Source # 
Instance details

Defined in Shrun.Command.Types.Internal

NFData CommandIndex Source # 
Instance details

Defined in Shrun.Command.Types.Internal

Methods

rnf :: CommandIndex -> () #

Enum CommandIndex Source # 
Instance details

Defined in Shrun.Command.Types.Internal

Generic CommandIndex Source # 
Instance details

Defined in Shrun.Command.Types.Internal

Associated Types

type Rep CommandIndex 
Instance details

Defined in Shrun.Command.Types.Internal

type Rep CommandIndex = D1 ('MetaData "CommandIndex" "Shrun.Command.Types.Internal" "shrun-0.10-inplace" 'True) (C1 ('MetaCons "MkCommandIndex" 'PrefixI 'True) (S1 ('MetaSel ('Just "unCommandIndex") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Positive Int))))
Show CommandIndex Source # 
Instance details

Defined in Shrun.Command.Types.Internal

Eq CommandIndex Source # 
Instance details

Defined in Shrun.Command.Types.Internal

Ord CommandIndex Source # 
Instance details

Defined in Shrun.Command.Types.Internal

Hashable CommandIndex Source # 
Instance details

Defined in Shrun.Command.Types.Internal

Pretty CommandIndex Source # 
Instance details

Defined in Shrun.Command.Types.Internal

(k ~ An_Iso, a ~ Positive Int, b ~ Positive Int) => LabelOptic "unCommandIndex" k CommandIndex CommandIndex a b Source # 
Instance details

Defined in Shrun.Command.Types.Internal

type Rep CommandIndex Source # 
Instance details

Defined in Shrun.Command.Types.Internal

type Rep CommandIndex = D1 ('MetaData "CommandIndex" "Shrun.Command.Types.Internal" "shrun-0.10-inplace" 'True) (C1 ('MetaCons "MkCommandIndex" 'PrefixI 'True) (S1 ('MetaSel ('Just "unCommandIndex") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Positive Int))))

range :: CommandIndex -> CommandIndex -> Either String (CommandIndex, NESeq CommandIndex) Source #

Given m, n s.t. m < n, returns [m .. n]. Notice this is strictly increasing.

joinRange :: (a, NESeq a) -> NESeq a Source #

Collapses range output back into a single NESeq.

Order

newtype CommandOrd (p :: CommandPhase) Source #

Wraps CommandP for the purposes of ordering by index.

Constructors

MkCommandOrd (CommandP p) 

Instances

Instances details
(k ~ An_Iso, a ~ CommandP p, b ~ CommandP p) => LabelOptic "unCommandOrd" k (CommandOrd p) (CommandOrd p) a b Source # 
Instance details

Defined in Shrun.Command.Types

Generic (CommandOrd p) Source # 
Instance details

Defined in Shrun.Command.Types

Associated Types

type Rep (CommandOrd p) 
Instance details

Defined in Shrun.Command.Types

type Rep (CommandOrd p) = Rep (CommandP p)

Methods

from :: CommandOrd p -> Rep (CommandOrd p) x #

to :: Rep (CommandOrd p) x -> CommandOrd p #

Eq (CommandOrd p) Source # 
Instance details

Defined in Shrun.Command.Types

Methods

(==) :: CommandOrd p -> CommandOrd p -> Bool #

(/=) :: CommandOrd p -> CommandOrd p -> Bool #

Ord (CommandOrd p) Source # 
Instance details

Defined in Shrun.Command.Types

Hashable (CommandOrd p) Source # 
Instance details

Defined in Shrun.Command.Types

type Rep (CommandOrd p) Source # 
Instance details

Defined in Shrun.Command.Types

type Rep (CommandOrd p) = Rep (CommandP p)

Status

data CommandStatus Source #

Represents a Command's status.

Constructors

CommandSuccess

The command ran successfully.

CommandFailure

The command failed.

CommandRunning (Maybe Pid, [Pid])

The command is running. It is associated to its own PID and child PIDs, for later cleanup.

CommandWaiting

The command is waiting to run.

Map

newtype CommandStatusMapP (p :: CommandStatusMapIndex) Source #

Command status map.

Constructors

MkCommandStatusMapP 

Fields

Instances

Instances details
(k ~ An_Iso, a ~ CommandStatusMapIndexF p, b ~ CommandStatusMapIndexF p) => LabelOptic "unCommandStatusMap" k (CommandStatusMapP p) (CommandStatusMapP p) a b Source # 
Instance details

Defined in Shrun.Command.Types

type TCommandStatusMap = CommandStatusMapP 'CommandStatusMapStm Source #

Normal status map, mutable in stm.

type CommandStatusMap = CommandStatusMapP 'CommandStatusMapPure Source #

Pure status map i.e. after the stm map has been read.

readCommandStatus :: (HasCallStack, MonadAtomic m) => TCommandStatusMap -> m CommandStatusMap Source #

Reads a map of TVars into a pure map via a single STM transaction.

Misc

type Vertex = Int Source #

Type for Command graph vertex, for usage with fgl.

type LVertex a = (Vertex, a) Source #

Labeled Vertex.