mirror of
https://github.com/github/semantic.git
synced 2024-11-28 10:15:55 +03:00
Implement the empty cases by pattern matching.
This commit is contained in:
parent
13499cc520
commit
676ef16162
@ -4,6 +4,6 @@ import Patch
|
|||||||
import Diff
|
import Diff
|
||||||
|
|
||||||
ses :: Eq a => [a] -> [a] -> [Either (Patch a) (a, a)]
|
ses :: Eq a => [a] -> [a] -> [Either (Patch a) (a, a)]
|
||||||
ses a b | Prelude.null a = (Left . Insert) <$> b
|
ses [] b = (Left . Insert) <$> b
|
||||||
ses a b | Prelude.null b = (Left . Delete) <$> a
|
ses a [] = (Left . Delete) <$> a
|
||||||
ses (a : as) (b : bs) | a == b = Right (a, b) : ses as bs
|
ses (a : as) (b : bs) | a == b = Right (a, b) : ses as bs
|
||||||
|
Loading…
Reference in New Issue
Block a user