| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Shrun.Command.Types.Internal
Description
Internal module. Take care as usage can violate invariants.
Synopsis
- newtype CommandIndex = MkCommandIndex {}
- fromPositive :: Positive Int -> CommandIndex
- unsafeFromInt :: HasCallStack => Int -> CommandIndex
- succ :: CommandIndex -> CommandIndex
- addNN :: CommandIndex -> NonNegative Int -> CommandIndex
- range :: CommandIndex -> CommandIndex -> Either String (CommandIndex, NESeq CommandIndex)
- joinRange :: (a, NESeq a) -> NESeq a
- type Vertex = Int
- type LVertex a = (Vertex, a)
- toVertex :: CommandIndex -> Vertex
- fromVertex :: HasCallStack => Vertex -> CommandIndex
Index
newtype 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.
Constructors
| MkCommandIndex | |
Fields | |
Instances
fromPositive :: Positive Int -> CommandIndex Source #
unsafeFromInt :: HasCallStack => Int -> CommandIndex Source #
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.
Vertex
fromVertex :: HasCallStack => Vertex -> CommandIndex Source #
Conversion from Vertex.