diff options
author | Tom Smeding <tom.smeding@gmail.com> | 2018-04-19 12:07:25 +0200 |
---|---|---|
committer | Tom Smeding <tom.smeding@gmail.com> | 2018-04-19 12:07:25 +0200 |
commit | caf9da01bf6663854c25fc2cc6457aa4fe7b88cf (patch) | |
tree | 4aa3b6a8380961058c6a86e41778a9eb95f32ab4 /Utility.hs | |
parent | af425841a63ee73603cc09510d95a36e646ddafd (diff) |
Diffstat (limited to 'Utility.hs')
-rw-r--r-- | Utility.hs | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -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 |