mirror of
https://github.com/github/semantic.git
synced 2025-01-02 20:41:38 +03:00
Specialize decompose to Syntax.
This commit is contained in:
parent
fe6d54ae04
commit
5223c2c59f
@ -109,9 +109,9 @@ runAlgorithm recur = iterAp $ \ r cont -> case r of
|
||||
where maybeRecur a b = if comparable a b then Just (recur (These a b)) else Nothing
|
||||
|
||||
-- | Decompose a step of an algorithm into the next steps to perform.
|
||||
decompose :: (Eq1 f, GAlign f, Traversable f, HasField fields Category, HasField fields (Maybe FeatureVector))
|
||||
=> AlgorithmF (Term f (Record fields)) (Diff f (Record fields)) result -- ^ The step in an algorithm to decompose into its next steps.
|
||||
-> Algorithm (Term f (Record fields)) (Diff f (Record fields)) result -- ^ The sequence of next steps to undertake to continue the algorithm.
|
||||
decompose :: (Eq leaf, HasField fields Category, HasField fields (Maybe FeatureVector))
|
||||
=> AlgorithmF (Term (Syntax leaf) (Record fields)) (Diff (Syntax leaf) (Record fields)) result -- ^ The step in an algorithm to decompose into its next steps.
|
||||
-> Algorithm (Term (Syntax leaf) (Record fields)) (Diff (Syntax leaf) (Record fields)) result -- ^ The sequence of next steps to undertake to continue the algorithm.
|
||||
decompose = \case
|
||||
Diff t1 t2 -> case (unwrap t1, unwrap t2) of
|
||||
_ -> byReplacing t1 t2
|
||||
|
Loading…
Reference in New Issue
Block a user