summaryrefslogtreecommitdiff
path: root/compiler/GHC/Data/Graph
diff options
context:
space:
mode:
authorBaldur Blöndal <baldurpet@gmail.com>2022-09-22 01:27:53 +0000
committerTopsii <tobiashaslop@hotmail.de>2022-11-30 21:16:36 +0100
commitd87f28d810b9c536ca4db7f363163e6d0dd6c93c (patch)
tree558597fb2921abf4c201019f9ade7b0037443751 /compiler/GHC/Data/Graph
parentb4cfa8e235715d8c73b2ba0ba05ed8ef92629218 (diff)
downloadhaskell-d87f28d810b9c536ca4db7f363163e6d0dd6c93c.tar.gz
Make Functor a quantified superclass of Bifunctor.
See https://github.com/haskell/core-libraries-committee/issues/91 for discussion. This change relates Bifunctor with Functor by requiring second = fmap. Moreover this change is a step towards unblocking the major version bump of bifunctors and profunctors to major version 6. This paves the way to move the Profunctor class into base. For that Functor first similarly becomes a superclass of Profunctor in the new major version 6.
Diffstat (limited to 'compiler/GHC/Data/Graph')
-rw-r--r--compiler/GHC/Data/Graph/Inductive/PatriciaTree.hs3
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/GHC/Data/Graph/Inductive/PatriciaTree.hs b/compiler/GHC/Data/Graph/Inductive/PatriciaTree.hs
index 626a1dd76b..2a58138044 100644
--- a/compiler/GHC/Data/Graph/Inductive/PatriciaTree.hs
+++ b/compiler/GHC/Data/Graph/Inductive/PatriciaTree.hs
@@ -116,6 +116,9 @@ instance DynGraph Gr where
in Gr g3
+instance Functor (Gr a) where
+ fmap = fastEMap
+
instance Bifunctor Gr where
bimap = fastNEMap