Skip to content
Snippets Groups Projects

Avoid name clash with Data.List.unsnoc in extra-1.7.13

Merged Tobias Haslop requested to merge tobias/head.hackage:unsnoc into master
+ 17
1
diff --git a/src/Data/List/Extra.hs b/src/Data/List/Extra.hs
index 68cbbcb..2222618 100644
index 68cbbcb..c8d26ed 100644
--- a/src/Data/List/Extra.hs
+++ b/src/Data/List/Extra.hs
@@ -45,7 +45,6 @@ import Data.Char
@@ -19,3 +19,19 @@ index 68cbbcb..2222618 100644
-- | A total variant of the list index function `(!!)`.
--
-- > [2,3,4] !? 1 == Just 3
@@ -189,6 +188,7 @@ list :: b -> (a -> [a] -> b) -> [a] -> b
list nil cons [] = nil
list nil cons (x:xs) = cons x xs
+#if __GLASGOW_HASKELL__ < 907
-- | If the list is empty returns 'Nothing', otherwise returns the 'init' and the 'last'.
--
-- > unsnoc "test" == Just ("tes",'t')
@@ -199,6 +199,7 @@ unsnoc [] = Nothing
unsnoc [x] = Just ([], x)
unsnoc (x:xs) = Just (x:a, b)
where Just (a,b) = unsnoc xs
+#endif
-- | Append an element to the start of a list, an alias for '(:)'.
--
Loading