1
1
mirror of https://github.com/github/semantic.git synced 2025-01-02 12:23:08 +03:00

Document time complexity.

This commit is contained in:
Rob Rix 2017-02-21 10:38:10 -05:00
parent 984be76b0f
commit 6f30690b71

View File

@ -6,11 +6,11 @@ import Prologue hiding (Pure)
-- | A single step in a diffing algorithm, parameterized by the types of terms, diffs, and the result of the applicable algorithm.
data AlgorithmF term diff result where
-- | Diff two terms recursively, resulting in a single diff node.
-- | Diff two terms recursively in O(n) time, resulting in a single diff node.
Recursive :: term -> term -> AlgorithmF term diff diff
-- | Diff two lists of terms by each elements position, resulting in a list of diffs.
-- | Diff two lists of terms by each elements position in O(n³) time, resulting in a list of diffs.
ByIndex :: [term] -> [term] -> AlgorithmF term diff [diff]
-- | Diff two lists of terms by each elements similarity, resulting in a list of diffs.
-- | Diff two lists of terms by each elements similarity in O(n³ log n), resulting in a list of diffs.
BySimilarity :: [term] -> [term] -> AlgorithmF term diff [diff]
-- | The free applicative for 'AlgorithmF'. This enables us to construct diff values using <$> and <*> notation.