Commit 05cf18f8 authored by Herbert Valerio Riedel's avatar Herbert Valerio Riedel 🕺
Browse files

Generalise (some of) Data.List to Foldables (re #9568)

This replaces the entities in Data.List conflicting with Data.Foldable
with re-exports of the generalised version from Data.Foldable.

As of this commit, the following compiles w/o error

    module XPrelude (module X) where

    import Control.Monad as X
    import Data.Foldable as X
    import Data.List as X
    import Prelude as X

Reviewed By: austin, dfeuer, ekmett

Differential Revision: https://phabricator.haskell.org/D229
parent 1812898c
......@@ -207,5 +207,8 @@ module Data.List
) where
import Data.Foldable ()
import Data.OldList
import Data.Foldable
import Data.OldList hiding ( all, and, any, concat, concatMap, elem, find,
foldl, foldl1, foldl', foldr, foldr1, maximum,
maximumBy, minimum, minimumBy, notElem, or,
product, sum )
......@@ -35,6 +35,16 @@
* Turn `toList`, `elem`, `sum`, `product`, `maximum`, and `minimum`
into `Foldable` methods (#9621)
* Replace the `Data.List`-exported functions
```
all, and, any, concat, concatMap, elem, find, product, sum
```
by re-exports of their generalised `Data.Foldable` counterparts.
In other words, unqualified imports of `Data.List` and
`Data.Foldable` no longer lead to conflicting definitions. (#9586)
## 4.7.0.1 *Jul 2014*
* Bundled with GHC 7.8.3
......
......@@ -3,5 +3,5 @@ rnfail032.hs:2:21:
Not in scope: ‘Data.List.map’
Perhaps you meant one of these:
‘Data.List.zip’ (imported from Data.List),
‘Data.List.sum’ (imported from Data.List),
‘Data.List.all’ (imported from Data.List)
‘Data.List.all’ (imported from Data.List),
‘Data.List.and’ (imported from Data.List)
......@@ -3,5 +3,5 @@ rnfail033.hs:2:21:
Not in scope: ‘Data.List.map’
Perhaps you meant one of these:
‘Data.List.zip’ (imported from Data.List),
‘Data.List.sum’ (imported from Data.List),
‘Data.List.all’ (imported from Data.List)
‘Data.List.all’ (imported from Data.List),
‘Data.List.and’ (imported from Data.List)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment