Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data TransactionIdLookup
- data TransactionIdHeadBacktrack
- data CommitOption
- data TransactionGraphOperator
- isCommit :: TransactionGraphOperator -> Bool
- data ROTransactionGraphOperator = ShowGraph
- bootstrapTransactionGraph :: TransactionId -> DatabaseContext -> TransactionGraph
- emptyTransactionGraph :: TransactionGraph
- transactionForHead :: HeadName -> TransactionGraph -> Maybe Transaction
- headList :: TransactionGraph -> [(HeadName, TransactionId)]
- headNameForTransaction :: Transaction -> TransactionGraph -> Maybe HeadName
- transactionForId :: TransactionId -> TransactionGraph -> Either RelationalError Transaction
- transactionsForIds :: Set TransactionId -> TransactionGraph -> Either RelationalError (Set Transaction)
- isRootTransaction :: Transaction -> TransactionGraph -> Bool
- parentTransactions :: Transaction -> TransactionGraph -> Either RelationalError (Set Transaction)
- childTransactions :: Transaction -> TransactionGraph -> Either RelationalError (Set Transaction)
- addBranch :: TransactionId -> HeadName -> TransactionId -> TransactionGraph -> Either RelationalError (Transaction, TransactionGraph)
- addDisconnectedTransaction :: TransactionId -> HeadName -> DisconnectedTransaction -> TransactionGraph -> Either RelationalError (Transaction, TransactionGraph)
- addTransactionToGraph :: HeadName -> Transaction -> TransactionGraph -> Either RelationalError (Transaction, TransactionGraph)
- validateGraph :: TransactionGraph -> Maybe [RelationalError]
- walkParentTransactions :: Set TransactionId -> TransactionGraph -> Transaction -> Maybe RelationalError
- walkChildTransactions :: Set TransactionId -> TransactionGraph -> Transaction -> Maybe RelationalError
- evalGraphOp :: TransactionId -> DisconnectedTransaction -> TransactionGraph -> TransactionGraphOperator -> Either RelationalError (DisconnectedTransaction, TransactionGraph)
- graphAsRelation :: DisconnectedTransaction -> TransactionGraph -> Either RelationalError Relation
- transactionParentsRelation :: Transaction -> TransactionGraph -> Either RelationalError Relation
- createMergeTransaction :: TransactionId -> MergeStrategy -> TransactionGraph -> (Transaction, Transaction) -> Either MergeError Transaction
- validateHeadName :: HeadName -> TransactionGraph -> (Transaction, Transaction) -> Either MergeError Transaction
- subGraphOfFirstCommonAncestor :: TransactionGraph -> TransactionHeads -> Transaction -> Transaction -> Set Transaction -> Either RelationalError TransactionGraph
- pathToTransaction :: TransactionGraph -> Transaction -> Transaction -> Set Transaction -> Either RelationalError (Set Transaction)
- mergeTransactions :: TransactionId -> TransactionId -> MergeStrategy -> (HeadName, HeadName) -> TransactionGraph -> Either RelationalError (DisconnectedTransaction, TransactionGraph)
- showTransactionStructureX :: Transaction -> TransactionGraph -> String
- showGraphStructureX :: TransactionGraph -> String
- filterSubGraph :: TransactionGraph -> TransactionHeads -> Either RelationalError TransactionGraph
- createUnionMergeTransaction :: TransactionId -> MergeStrategy -> TransactionGraph -> (Transaction, Transaction) -> Either MergeError Transaction
- lookupTransaction :: TransactionGraph -> TransactionIdLookup -> Either RelationalError Transaction
- traverseGraph :: TransactionGraph -> TransactionId -> [TransactionIdHeadBacktrack] -> Either RelationalError TransactionId
- backtrackGraph :: TransactionGraph -> TransactionId -> TransactionIdHeadBacktrack -> Either RelationalError TransactionId
Documentation
data TransactionIdLookup Source #
Record a lookup for a specific transaction in the graph.
data TransactionIdHeadBacktrack Source #
Used for git-style head backtracking such as topic~3^2.
TransactionIdHeadParentBacktrack Int | git equivalent of ~: walk back n parents, arbitrarily choosing a parent when a choice must be made |
TransactionIdHeadBranchBacktrack Int | git equivalent of ^: walk back one parent level to the nth arbitrarily-chosen parent |
data CommitOption Source #
data TransactionGraphOperator Source #
Operators which manipulate a transaction graph and which transaction the current Session
is based upon.
headList :: TransactionGraph -> [(HeadName, TransactionId)] Source #
transactionForId :: TransactionId -> TransactionGraph -> Either RelationalError Transaction Source #
transactionsForIds :: Set TransactionId -> TransactionGraph -> Either RelationalError (Set Transaction) Source #
isRootTransaction :: Transaction -> TransactionGraph -> Bool Source #
parentTransactions :: Transaction -> TransactionGraph -> Either RelationalError (Set Transaction) Source #
childTransactions :: Transaction -> TransactionGraph -> Either RelationalError (Set Transaction) Source #
addBranch :: TransactionId -> HeadName -> TransactionId -> TransactionGraph -> Either RelationalError (Transaction, TransactionGraph) Source #
addDisconnectedTransaction :: TransactionId -> HeadName -> DisconnectedTransaction -> TransactionGraph -> Either RelationalError (Transaction, TransactionGraph) Source #
addTransactionToGraph :: HeadName -> Transaction -> TransactionGraph -> Either RelationalError (Transaction, TransactionGraph) Source #
walkParentTransactions :: Set TransactionId -> TransactionGraph -> Transaction -> Maybe RelationalError Source #
walkChildTransactions :: Set TransactionId -> TransactionGraph -> Transaction -> Maybe RelationalError Source #
evalGraphOp :: TransactionId -> DisconnectedTransaction -> TransactionGraph -> TransactionGraphOperator -> Either RelationalError (DisconnectedTransaction, TransactionGraph) Source #
graphAsRelation :: DisconnectedTransaction -> TransactionGraph -> Either RelationalError Relation Source #
transactionParentsRelation :: Transaction -> TransactionGraph -> Either RelationalError Relation Source #
createMergeTransaction :: TransactionId -> MergeStrategy -> TransactionGraph -> (Transaction, Transaction) -> Either MergeError Transaction Source #
Execute the merge strategy against the transactions, returning a new transaction which can be then added to the transaction graph
validateHeadName :: HeadName -> TransactionGraph -> (Transaction, Transaction) -> Either MergeError Transaction Source #
Returns the correct Transaction for the branch name in the graph and ensures that it is one of the two transaction arguments in the tuple.
subGraphOfFirstCommonAncestor :: TransactionGraph -> TransactionHeads -> Transaction -> Transaction -> Set Transaction -> Either RelationalError TransactionGraph Source #
pathToTransaction :: TransactionGraph -> Transaction -> Transaction -> Set Transaction -> Either RelationalError (Set Transaction) Source #
Search from a past graph point to all following heads for a specific transaction. If found, return the transaction path, otherwise a RelationalError.
mergeTransactions :: TransactionId -> TransactionId -> MergeStrategy -> (HeadName, HeadName) -> TransactionGraph -> Either RelationalError (DisconnectedTransaction, TransactionGraph) Source #
filterSubGraph :: TransactionGraph -> TransactionHeads -> Either RelationalError TransactionGraph Source #
After splicing out a subgraph, run it through this function to remove references to transactions which are not in the subgraph.
createUnionMergeTransaction :: TransactionId -> MergeStrategy -> TransactionGraph -> (Transaction, Transaction) -> Either MergeError Transaction Source #
lookupTransaction :: TransactionGraph -> TransactionIdLookup -> Either RelationalError Transaction Source #