The following import statement causes a conflict with foldr et al. because the first import statement seems to import all the functions in Data.Foldable into my module:
import Data.Foldable (Foldable (..))
import qualified Data.Foldable as Foldable (foldr, foldl, foldr1, foldl1, foldMap)
This import statement seems to work. However the Foldable class is now Foldable.Foldable:
import qualified Data.Foldable as Foldable (Foldable (..), foldr, foldl, foldr1, foldl1, foldMap)
The
foldretc. are class methods ofFoldable, hence they’re imported unqualified byimport Data.Foldable (Foldable(..))in the first variant.To only import the class unqualified, not its methods, use