summaryrefslogtreecommitdiff
path: root/Utility.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Utility.hs')
-rw-r--r--Utility.hs2
1 files changed, 2 insertions, 0 deletions
diff --git a/Utility.hs b/Utility.hs
index a160cb7..e2c245d 100644
--- a/Utility.hs
+++ b/Utility.hs
@@ -18,6 +18,8 @@ setcompareBy p a@(x:xs) b = length a == length b && setcompareBy p xs (deleteBy
deleteIndex :: Int -> [a] -> [a]
deleteIndex 0 (_:xs) = xs
deleteIndex i (x:xs) | i > 0 = x : deleteIndex (i-1) xs
+ | otherwise = error "Negative index in deleteIndex"
+deleteIndex _ [] = error "Too high index in deleteIndex"
fromLeft :: Either a b -> a
fromLeft (Left a) = a