1
1
mirror of https://github.com/github/semantic.git synced 2024-12-25 16:02:43 +03:00

SES returns Either.

This commit is contained in:
Rob Rix 2015-11-18 07:25:26 -08:00
parent e742cf6859
commit 8b3c1aacfd

View File

@ -2,8 +2,7 @@ module SES where
import Patch
import Diff
import Control.Monad.Free
ses :: Functor f => Eq a => [a] -> [a] -> [Free f (Patch a)]
ses a b | Prelude.null a = (Pure . Insert) <$> b
ses a b | Prelude.null b = (Pure . Delete) <$> a
ses :: Eq a => [a] -> [a] -> [Either (Patch a) a]
ses a b | Prelude.null a = (Left . Insert) <$> b
ses a b | Prelude.null b = (Left . Delete) <$> a