diff options
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 |