From 676ef16162de8ab8b5d28c335cf0d5fdf5b00786 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Wed, 18 Nov 2015 07:27:19 -0800 Subject: [PATCH] Implement the empty cases by pattern matching. --- src/SES.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/SES.hs b/src/SES.hs index b067dd889..5e83a7601 100644 --- a/src/SES.hs +++ b/src/SES.hs @@ -4,6 +4,6 @@ import Patch import Diff ses :: Eq a => [a] -> [a] -> [Either (Patch a) (a, a)] -ses a b | Prelude.null a = (Left . Insert) <$> b -ses a b | Prelude.null b = (Left . Delete) <$> a +ses [] b = (Left . Insert) <$> b +ses a [] = (Left . Delete) <$> a ses (a : as) (b : bs) | a == b = Right (a, b) : ses as bs