summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorViktor Dukhovni <ietf-dane@dukhovni.org>2021-09-27 23:30:19 -0400
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-10-05 14:33:29 -0400
commit56899c8dce95a6fe4c47291a3a1dd1c49b0d0dfb (patch)
treec575bf572a4a93e84275d342e06b6bf6bc8f6e52
parent43358ab9d4cfd87971c8e07685d24713d713f7c8 (diff)
downloadhaskell-56899c8dce95a6fe4c47291a3a1dd1c49b0d0dfb.tar.gz
Note elem ticket 20421
-rw-r--r--libraries/base/Data/Foldable.hs4
1 files changed, 4 insertions, 0 deletions
diff --git a/libraries/base/Data/Foldable.hs b/libraries/base/Data/Foldable.hs
index 34fcb5a370..fdd8429cf1 100644
--- a/libraries/base/Data/Foldable.hs
+++ b/libraries/base/Data/Foldable.hs
@@ -2452,6 +2452,10 @@ elements in a single pass.
-- > instance Ord a => HasMember Set.Set a where
-- > member = Set.member
--
+-- The above suggests that 'elem' may be a misfit in the 'Foldable' class.
+-- Alternative design ideas are solicited on GHC's bug tracker via issue
+-- [\#20421](https://gitlab.haskell.org/ghc/ghc/-/issues/20421).
+--
-- Note that some structure-specific optimisations may of course be possible
-- directly in the corresponding @Foldable@ instance, e.g. with @Set@ the size
-- of the set is known in advance, without iterating to count the elements, and