| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Shrun.Command.Types
Description
Provides the Command wrapper for commands.
Synopsis
- data CommandP (p :: CommandPhase) = MkCommandP {}
- type CommandP1 = CommandP 'CommandPhase1
- type CommandP2 = CommandP 'CommandPhase2
- commandToProcess :: CommandP1 -> Maybe Text -> CreateProcess
- data CommandIndex
- fromPositive :: Positive Int -> CommandIndex
- unsafeFromInt :: HasCallStack => Int -> CommandIndex
- toVertex :: CommandIndex -> Vertex
- fromVertex :: HasCallStack => Vertex -> CommandIndex
- succ :: CommandIndex -> CommandIndex
- addNN :: CommandIndex -> NonNegative Int -> CommandIndex
- range :: CommandIndex -> CommandIndex -> Either String (CommandIndex, NESeq CommandIndex)
- joinRange :: (a, NESeq a) -> NESeq a
- newtype CommandOrd (p :: CommandPhase) = MkCommandOrd (CommandP p)
- data CommandStatus
- newtype CommandStatusMapP (p :: CommandStatusMapIndex) = MkCommandStatusMapP {
- unCommandStatusMap :: CommandStatusMapIndexF p
- type TCommandStatusMap = CommandStatusMapP 'CommandStatusMapStm
- type CommandStatusMap = CommandStatusMapP 'CommandStatusMapPure
- readCommandStatus :: (HasCallStack, MonadAtomic m) => TCommandStatusMap -> m CommandStatusMap
- data CommandPhase
- type Vertex = Int
- type LVertex a = (Vertex, a)
Command
data CommandP (p :: CommandPhase) Source #
Wrapper for shell commands. Whenever the CommandIndex order is important,
see CommandOrd.
Constructors
| MkCommandP | |
Instances
type CommandP1 = CommandP 'CommandPhase1 Source #
Phase1 commands.
type CommandP2 = CommandP 'CommandPhase2 Source #
Phase2 commands.
commandToProcess :: CommandP1 -> Maybe Text -> CreateProcess Source #
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
| ASemigroup CommandIndex Source # | |||||
Defined in Shrun.Command.Types.Internal Methods (.+.) :: CommandIndex -> CommandIndex -> CommandIndex Source # | |||||
| MMonoid CommandIndex Source # | |||||
Defined in Shrun.Command.Types.Internal Methods one :: CommandIndex Source # | |||||
| MSemigroup CommandIndex Source # | |||||
Defined in Shrun.Command.Types.Internal Methods (.*.) :: CommandIndex -> CommandIndex -> CommandIndex Source # | |||||
| NFData CommandIndex Source # | |||||
Defined in Shrun.Command.Types.Internal Methods rnf :: CommandIndex -> () # | |||||
| Enum CommandIndex Source # | |||||
Defined in Shrun.Command.Types.Internal Methods succ :: CommandIndex -> CommandIndex # pred :: CommandIndex -> CommandIndex # toEnum :: Int -> CommandIndex # fromEnum :: CommandIndex -> Int # enumFrom :: CommandIndex -> [CommandIndex] # enumFromThen :: CommandIndex -> CommandIndex -> [CommandIndex] # enumFromTo :: CommandIndex -> CommandIndex -> [CommandIndex] # enumFromThenTo :: CommandIndex -> CommandIndex -> CommandIndex -> [CommandIndex] # | |||||
| Generic CommandIndex Source # | |||||
Defined in Shrun.Command.Types.Internal Associated Types
| |||||
| Show CommandIndex Source # | |||||
Defined in Shrun.Command.Types.Internal Methods showsPrec :: Int -> CommandIndex -> ShowS # show :: CommandIndex -> String # showList :: [CommandIndex] -> ShowS # | |||||
| Eq CommandIndex Source # | |||||
Defined in Shrun.Command.Types.Internal | |||||
| Ord CommandIndex Source # | |||||
Defined in Shrun.Command.Types.Internal Methods compare :: CommandIndex -> CommandIndex -> Ordering # (<) :: CommandIndex -> CommandIndex -> Bool # (<=) :: CommandIndex -> CommandIndex -> Bool # (>) :: CommandIndex -> CommandIndex -> Bool # (>=) :: CommandIndex -> CommandIndex -> Bool # max :: CommandIndex -> CommandIndex -> CommandIndex # min :: CommandIndex -> CommandIndex -> CommandIndex # | |||||
| Hashable CommandIndex Source # | |||||
Defined in Shrun.Command.Types.Internal | |||||
| Pretty CommandIndex Source # | |||||
Defined in Shrun.Command.Types.Internal | |||||
| (k ~ An_Iso, a ~ Positive Int, b ~ Positive Int) => LabelOptic "unCommandIndex" k CommandIndex CommandIndex a b Source # | |||||
Defined in Shrun.Command.Types.Internal Methods labelOptic :: Optic k NoIx CommandIndex CommandIndex a b Source # | |||||
| type Rep CommandIndex Source # | |||||
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)))) | |||||
fromPositive :: Positive Int -> CommandIndex Source #
unsafeFromInt :: HasCallStack => Int -> CommandIndex Source #
fromVertex :: HasCallStack => Vertex -> CommandIndex Source #
Conversion from Vertex.
succ :: CommandIndex -> CommandIndex Source #
addNN :: CommandIndex -> NonNegative Int -> CommandIndex Source #
range :: CommandIndex -> CommandIndex -> Either String (CommandIndex, NESeq CommandIndex) Source #
Given m, n s.t. m < n, returns [m .. n]. Notice this is strictly increasing.
Order
newtype CommandOrd (p :: CommandPhase) Source #
Wraps CommandP for the purposes of ordering by index.
Constructors
| MkCommandOrd (CommandP p) |
Instances
| (k ~ An_Iso, a ~ CommandP p, b ~ CommandP p) => LabelOptic "unCommandOrd" k (CommandOrd p) (CommandOrd p) a b Source # | |||||
Defined in Shrun.Command.Types Methods labelOptic :: Optic k NoIx (CommandOrd p) (CommandOrd p) a b Source # | |||||
| Generic (CommandOrd p) Source # | |||||
Defined in Shrun.Command.Types Associated Types
| |||||
| Eq (CommandOrd p) Source # | |||||
Defined in Shrun.Command.Types | |||||
| Ord (CommandOrd p) Source # | |||||
Defined in Shrun.Command.Types Methods compare :: CommandOrd p -> CommandOrd p -> Ordering # (<) :: CommandOrd p -> CommandOrd p -> Bool # (<=) :: CommandOrd p -> CommandOrd p -> Bool # (>) :: CommandOrd p -> CommandOrd p -> Bool # (>=) :: CommandOrd p -> CommandOrd p -> Bool # max :: CommandOrd p -> CommandOrd p -> CommandOrd p # min :: CommandOrd p -> CommandOrd p -> CommandOrd p # | |||||
| Hashable (CommandOrd p) Source # | |||||
Defined in Shrun.Command.Types | |||||
| type Rep (CommandOrd p) Source # | |||||
Defined in Shrun.Command.Types | |||||
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
| (k ~ An_Iso, a ~ CommandStatusMapIndexF p, b ~ CommandStatusMapIndexF p) => LabelOptic "unCommandStatusMap" k (CommandStatusMapP p) (CommandStatusMapP p) a b Source # | |
Defined in Shrun.Command.Types Methods labelOptic :: Optic k NoIx (CommandStatusMapP p) (CommandStatusMapP p) a b Source # | |
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
data CommandPhase Source #
Constructors
| CommandPhase1 | |
| CommandPhase2 |