1
1
mirror of https://github.com/github/semantic.git synced 2024-12-22 06:11:49 +03:00

Define run by iteration.

This commit is contained in:
Rob Rix 2017-02-24 13:42:53 -05:00
parent 209e7c0896
commit 4992299dd8

View File

@ -26,7 +26,7 @@ diffTerms = (run .) . diff
run :: (Eq leaf, HasField fields Category, HasField fields (Maybe FeatureVector))
=> Algorithm (SyntaxTerm leaf fields) (SyntaxDiff leaf fields) result
-> result
run = either identity run . runStep
run = iterFreer (\ algorithm cont -> cont (run (decompose algorithm)))
-- | Run an Algorithm to completion, returning the list of steps taken.
runSteps :: (Eq leaf, HasField fields Category, HasField fields (Maybe FeatureVector))